﻿using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using JNPF.Basics.Models;
using JNPF.Utils.Models.CodeBuilder;
using JNPF.Basics.Models.CodeBuilder.Template4;
using JNPF.Utils;
using JNPF.Utils.Extensions;
using JNPF.Basics.Models.VisualDev;
using System.Linq;
using System.IO;
using System.Text;
using JNPF.Basics.Models.VisualDevModelData;
using DbTableRelationModel = JNPF.Utils.DbTableRelationModel;
using JNPF.Utils.Helper;
using System.Text.RegularExpressions;
using JNPF.Basics.Models.DataInterface.Entities;
using JNPF.Basics.Logic.DataInterface;

namespace JNPF.Basics.Logic
{
    /// <summary>
    /// 可视化开发功能
    /// 版 本：V3.0.0
    /// 版 权：引迈信息技术有限公司（https://www.jnpfsoft.com）
    /// 作 者：JNPF开发平台组
    /// 日 期：2020-10-28
    /// </summary>
    public class VisualDevBll
    {
        private VisualDevIService service = new VisualDevService();
        private DatabaseIService dataService = new DatabaseService();
        private DictionaryDataIService dictionaryService = new DictionaryDataService();
        private DataInterfaceIService dataInterfaceService = new DataInterfaceService();
        private DbLinkIService dbLinkservice = new DbLinkService();

        private CodeGenerator Instance = new CodeGenerator(new CodeGenerateOption
        {
            ModelsNamespace = "JNPF.Basics.Models",
            EntityNamespace = "JNPF.Basics.Models",
            RepositoriesNamespace = "JNPF.Basics.Logic",
            ControllersNamespace = "JNPF.Basics.Controller",
            IServicesNamespace = "JNPF.Basics.Logic",
            ServicesNamespace = "JNPF.Basics.Logic",
            OutputPath = ConfigurationKey.CodeGeneratorFilePath,
        });
        /// <summary>
        /// 生成表单数据参数
        /// </summary>
        private List<GeneratorFormColumn> GeneratorFormDataList = new List<GeneratorFormColumn>();

        /// <summary>
        /// 生成表单数据OptionsList
        /// </summary>
        private Dictionary<string, object> GeneratorFormDataOptionsList = new Dictionary<string, object>();

        private Dictionary<string, object> GeneratorFormTableColumnList = new Dictionary<string, object>();

        /// <summary>
        /// 储存移动端控件列表
        /// </summary>
        private List<string> GeneratorAppFormControls = new List<string>();

        /// <summary>
        /// 列表查询控件类型
        /// </summary>
        private Dictionary<string, List<string>> ListQueryControlsType = new Dictionary<string, List<string>>();

        /// <summary>
        /// 构造函数
        /// </summary>
        public VisualDevBll()
        {
            var useInputList = new List<string>();
            useInputList.Add("comInput");
            useInputList.Add("textarea");
            useInputList.Add("JNPFText");
            useInputList.Add("numInput");
            useInputList.Add("JNPFAmount");
            useInputList.Add("billRule");
            useInputList.Add("createUser");
            useInputList.Add("modifyUser");
            useInputList.Add("currOrganize");
            useInputList.Add("currDept");
            useInputList.Add("currPosition");
            ListQueryControlsType["inputList"] = useInputList;

            var useDateList = new List<string>();
            useDateList.Add("createTime");
            useDateList.Add("modifyTime");
            ListQueryControlsType["dateList"] = useDateList;

            var useSelectList = new List<string>();
            useSelectList.Add("select");
            useSelectList.Add("radio");
            useSelectList.Add("checkbox");
            ListQueryControlsType["selectList"] = useSelectList;
        }

        /// <summary>
        /// 列表（分页）
        /// </summary>
        /// <param name="input">请求参数</param>
        /// <returns></returns>
        public async Task<PageResult<VisualDevEntity>> GetList(VisualDevListQueryInput input)
        {
            try
            {
                return await service.GetList(input);
            }
            catch (Exception ex)
            {
                throw ExceptionEx.Throw(ex);
            }
        }

        /// <summary>
        /// 列表
        /// </summary>
        /// <param name="input">请求参数</param>
        /// <returns></returns>
        public async Task<List<VisualDevEntity>> GetList()
        {
            try
            {
                return await service.GetList();
            }
            catch (Exception ex)
            {
                throw ExceptionEx.Throw(ex);
            }
        }

        /// <summary>
        /// 获取功能信息
        /// </summary>
        /// <param name="id">主键值</param>
        /// <returns></returns>
        public async Task<VisualDevEntity> GetInfo(string id)
        {
            try
            {
                return await service.GetInfo(id);
            }
            catch (Exception ex)
            {
                throw ExceptionEx.Throw(ex);
            }
        }

        /// <summary>
        /// 创建新功能信息
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public async Task<int> Create(VisualDevEntity entity)
        {
            try
            {
                entity.Id = CommonHelper.Guid;
                entity.EnabledMark = 1;
                entity.CreatorTime = DateTime.Now;
                entity.CreatorUserId = UserProvider.Instance.Get().UserId;
                return await service.Create(entity);
            }
            catch (Exception ex)
            {
                throw ExceptionEx.Throw(ex);
            }
        }

        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="id">主键值</param>
        /// <param name="entity">实体对象</param>
        public async Task<int> Update(string id, VisualDevEntity entity)
        {
            try
            {
                entity.Id = id;
                entity.LastModifyTime = DateTime.Now;
                entity.LastModifyUserId = UserProvider.Instance.Get().UserId;
                return await service.Update(entity);
            }
            catch (Exception ex)
            {
                throw ExceptionEx.Throw(ex);
            }
        }

        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public async Task<int> Delete(VisualDevEntity entity)
        {
            try
            {
                entity.LastModifyTime = DateTime.Now;
                entity.LastModifyUserId = UserProvider.Instance.Get().UserId;
                return await service.Delete(entity);
            }
            catch (Exception ex)
            {
                throw ExceptionEx.Throw(ex);
            }
        }

        /// <summary>
        /// 模型数据聚合
        /// </summary>
        /// <param name="fileName">文件夹名称</param>
        /// <param name="entity">模板数据</param>
        /// <param name="model"></param>
        /// <param name="childTb">子表数据</param>
        /// <param name="module">命名空间</param>
        public async Task GetFormModelTemplates(string fileName, VisualDevEntity entity, List<string> childTb, string module)
        {
            var tableRelation = entity.Tables.ToObject<List<DbTableRelationModel>>();
            var tableForm = TemplateKeywordsHelper.ReplaceKeywords(entity.FormData).ToObject<FormDataModel>();
            var model = entity.ColumnData.ToObject<ColumnDataModel>();
            Instance.Option.OutputPath = Instance.Option.OutputPath + fileName + @"/Net";
            foreach (var relation in tableRelation)
            {
                var tableList = new List<DbTableFieldModel>();
                tableList = dataService.GetFieldListByNoAsync(null, relation.table);
                var tableColumns = new List<DbTableColumn>();
                foreach (var table in tableList)
                {
                    var column = new DbTableColumn()
                    {
                        TableName = relation.table,
                        ColName = table.Field,
                        Alias = table.Field.Replace("F_", "").Replace("f_", "").ToPascalCase(),
                        IsIdentity = table.Identity == null ? false : true,
                        IsPrimaryKey = table.PrimaryKey == 1 ? true : false,
                        ColumnType = table.DataType,
                        IsNullable = table.AllowNull == 1 ? false : true,
                        Comments = table.FieldName,
                        CSharpType = GetCSharpType(table.DataType),
                        ColumnLength = table.DataLength.ToLong()
                    };
                    tableColumns.Add(column);
                }
                //拼接DbTable实体
                var alias = relation.table.ToPascalCase();
                var dbTable = new DbTable()
                {
                    TableName = relation.table,
                    Alias = alias.LowerFirstChar(),
                    TableComment = relation.tableName,
                    Columns = tableColumns
                };
                var tableComment = dbTable.TableComment;
                Instance.GenerateEntity(dbTable, true);


                //需要根据模板数据中获取到按钮
                //功能开关
                var funcSwitch = new List<CodeGeneratorFuncSwitchModel>();
                funcSwitch.Add(new CodeGeneratorFuncSwitchModel()
                {
                    funcSwitch = "info",
                    tableRelationTag = relation.relationTable == "" ? 0 : 1,
                    relationField = relation.tableField
                });
                if (model.hasPage)
                {
                    funcSwitch.Add(new CodeGeneratorFuncSwitchModel()
                    {
                        funcSwitch = "Page",
                        tableRelationTag = relation.relationTable == "" ? 0 : 1,
                        relationField = relation.tableField
                    });
                }
                else
                {
                    funcSwitch.Add(new CodeGeneratorFuncSwitchModel()
                    {
                        funcSwitch = "noPage",
                        tableRelationTag = relation.relationTable == "" ? 0 : 1,
                        relationField = relation.tableField
                    });
                }
                model.btnsList.ForEach(b =>
                {
                    funcSwitch.Add(new CodeGeneratorFuncSwitchModel()
                    {
                        funcSwitch = b.value,
                        tableRelationTag = relation.relationTable == "" ? 0 : 1,
                        relationField = relation.tableField
                    });
                });
                model.columnBtnsList.ForEach(b =>
                {
                    funcSwitch.Add(new CodeGeneratorFuncSwitchModel()
                    {
                        funcSwitch = b.value,
                        tableRelationTag = relation.relationTable == "" ? 0 : 1,
                        relationField = relation.tableField
                    });
                });
                var searchList = new List<DbTableColumn>();
                var childTable = tableRelation.Where(t => t.relationTable != "").ToList();
                //主表处理逻辑
                if (relation.relationTable == "")
                {
                    var columnPrimary = dbTable.Columns.ToList().Find(c => c.IsPrimaryKey);
                    //生成前端Form界面
                    Instance.GenerateVueForm(dbTable.Alias, columnPrimary.Alias, module + "/" + dbTable.Alias, await GenerateFormControls(tableForm), GenerateFormDataParameter(tableRelation), GenerateFormDataOptions(), GenerateDataInitMethods(tableRelation), GenerateDataListInitMethods(), GeneratorFormTableColumn(), GenerateDictionaryDataCreated(), GenerateDictionaryDataMethods(), GeneratorFormValidation(), GenerateFormFileDataParameter(), GenerateDataListFormSubmit());
                    //生成前端Index界面
                    Instance.GenerateVueIndex(dbTable.Alias, module + "/" + dbTable.Alias, GenerateIndexPage(model, columnPrimary.Alias), GenerateQueryParameter(model), GenerateHasPageParameter(model), GenerateDataColumnList(model), GenerateDictionaryDataCreated(), GenerateDictionaryDataMethods(), GenerateFormDataOptions(), GenerateFormTreeParameter(model), GenerateFormCreated(model), GenerateFormTreeMethods(model));
                    //生成前端ExportBox界面
                    Instance.GenerateVueExportBox(dbTable.Alias);

                    //创建输入
                    var modelFileName = dbTable.Alias + "CrInput";
                    dbTable.TableComment = string.Format("新建{0}输入", tableComment);
                    var createList = new List<DbTableColumn>();
                    foreach (var item in tableColumns)
                    {
                        var columnName = GeneratorFormDataList.Find(f => f.Model == (item.Alias.LowerFirstChar()));
                        if (columnName != null)
                        {
                            createList.Add(item);
                        }
                    }
                    dbTable.Columns = createList;
                    var childTableName = new List<string>();
                    if (childTable.Count > 0)
                    {
                        childTable.ForEach(c =>
                        {
                            var tableName = c.table.ToPascalCase();
                            childTableName.Add(tableName.LowerFirstChar());
                        });
                    }
                    Instance.GenerateModelEntity(dbTable, modelFileName, childTableName, null, null, false, true);

                    //生成Input实体类
                    tableColumns.ForEach(t =>
                    {
                        model.searchList.ForEach(s =>
                        {
                            if (s.__vModel__ == t.ColName)
                            {
                                searchList.Add(t);
                            }
                        });
                        //查询左侧树是否存在查询列表内
                        if (!model.searchList.Select(p => p.__vModel__ == model.treeDbTableFieldRelation).ToBool() && model.type == 2)
                        {
                            var param = model.treeDbTableFieldRelation.Replace("F_", "").Replace("f_", "").ToPascalCase();
                            if (t.ColName == param)
                            {
                                searchList.Add(t);
                            }
                        }
                    });
                    dbTable.Columns = searchList;
                    //查询列表输入
                    modelFileName = dbTable.Alias + "ListQueryInput";
                    dbTable.TableComment = string.Format("{0}查询列表输入", tableComment);
                    Instance.GenerateModelEntity(dbTable, modelFileName, null, null, null, true, true);
                    //生成Output实体类
                    var columnList = new List<DbTableColumn>();
                    columnList.Add(tableColumns.Find(t => t.IsPrimaryKey == true));
                    tableColumns.ForEach(t =>
                    {
                        var columnName = GeneratorFormDataList.Where(f => f.Model == (t.Alias.LowerFirstChar())).FirstOrDefault();
                        if (columnName != null)
                        {
                            t.IsMultiple = columnName.multiple;
                            columnList.Add(t);
                        }
                    });
                    dbTable.Columns = columnList;
                    //信息输出
                    modelFileName = dbTable.Alias + "UpOutput";
                    dbTable.TableComment = string.Format("{0}信息输出", tableComment);
                    Instance.GenerateModelEntity(dbTable, modelFileName, childTableName, null, GeneratorFormDataList, false, true);

                    columnList = new List<DbTableColumn>();
                    columnList.Add(tableColumns.Find(t => t.IsPrimaryKey == true));
                    tableColumns.ForEach(t =>
                    {
                        model.columnList.ForEach(c =>
                        {
                            if (c.prop == t.ColName)
                            {
                                columnList.Add(t);
                            }
                        });
                    });
                    dbTable.Columns = columnList;
                    //查询列表输出
                    modelFileName = dbTable.Alias + "ListOutput";
                    dbTable.TableComment = string.Format("{0}列表输出", tableComment);
                    Instance.GenerateModelEntity(dbTable, modelFileName, childTableName, null, GeneratorFormDataList, false, true);
                    //生成APIController
                    dbTable.TableComment = tableComment;
                    Instance.GenerateApiController(funcSwitch, module, dbTable, GeneratorFormDataList, childTable, true);
                    if (!funcSwitch.Select(p => p.funcSwitch == "Page").ToBool())
                    {
                        funcSwitch.Add(new CodeGeneratorFuncSwitchModel()
                        {
                            funcSwitch = "noPage",
                            tableRelationTag = relation.relationTable == "" ? 0 : 1,
                            relationField = relation.tableField
                        });
                    }
                    else
                    {
                        funcSwitch.Add(new CodeGeneratorFuncSwitchModel()
                        {
                            funcSwitch = "Page",
                            tableRelationTag = relation.relationTable == "" ? 0 : 1,
                            relationField = relation.tableField
                        });
                    }
                    //生成Bll
                    Instance.GenerateBll(funcSwitch, dbTable, GeneratorFormDataList, true);
                    //生成IService
                    Instance.GenerateIService(funcSwitch, dbTable.Alias, true);
                    //生成Service
                    //生成排序字段
                    string sidx = model.defaultSidx;
                    string sort = model.sort;
                    Instance.GenerateService(funcSwitch, searchList, GeneratorFormDataList, dbTable, sidx, sort, true);
                }
                if (relation.relationTable != "")
                {
                    //生成Bll
                    Instance.GenerateBll(funcSwitch, dbTable, GeneratorFormDataList, true);
                    var tableName = relation.table.ToPascalCase();
                    var chlidTableFileName = tableName.LowerFirstChar() + "CrInput";
                    //生成子表创建输入出
                    var chlidtableColumn = GeneratorFormTableColumnList.Where(f => f.Key.Contains(tableName.LowerFirstChar())).FirstOrDefault();
                    var columnList = new List<DbTableColumn>();
                    if (!default(KeyValuePair<string, object>).Equals(chlidtableColumn))
                    {
                        tableColumns.ForEach(t =>
                        {
                            var columnName = (chlidtableColumn.Value as List<string>).FindAll(f => f == t.Alias).FirstOrDefault();
                            if (columnName != null)
                            {
                                columnList.Add(t);
                            }
                        });
                        dbTable.Columns = columnList;
                        var modelFileName = dbTable.Alias + "CrInput";
                        dbTable.TableComment = string.Format("{0}创建输入", tableComment);
                        Instance.GenerateModelEntity(dbTable, modelFileName, null, null, GeneratorFormDataList, false, true);
                        modelFileName = dbTable.Alias + "UpOutput";
                        dbTable.TableComment = string.Format("{0}编辑输出", tableComment);
                        Instance.GenerateModelEntity(dbTable, modelFileName, null, null, GeneratorFormDataList, false, true);
                    }
                    //生成IService
                    Instance.GenerateIService(funcSwitch, dbTable.Alias, true);
                    //生成Service
                    Instance.GenerateService(funcSwitch, searchList, GeneratorFormDataList, dbTable, null, null, true);
                }
            }
        }

        /// <summary>
        /// 流程表单模型数据聚合
        /// </summary>
        /// <param name="fileName">文件夹名称</param>
        /// <param name="entity"></param>
        /// <param name="childTb"></param>
        /// <param name="module"></param>
        public void GetFlowModelTemplates(string fileName, VisualDevEntity entity, List<string> childTb, string module)


        {
            var tableRelation = entity.Tables.ToObject<List<DbTableRelationModel>>();
            var tableForm = TemplateKeywordsHelper.ReplaceKeywords(entity.FormData).ToObject<FormDataModel>();
            var model = entity.ColumnData.ToObject<ColumnDataModel>();
            Instance.Option.OutputPath = Instance.Option.OutputPath + fileName + @"/Net";
            foreach (var relation in tableRelation)
            {
                var tableList = new List<DbTableFieldModel>();
                tableList = dataService.GetFieldListByNoAsync(null, relation.table);
                var tableColumns = new List<DbTableColumn>();
                foreach (var table in tableList)
                {
                    var column = new DbTableColumn()
                    {
                        TableName = relation.table,
                        ColName = table.Field,
                        Alias = table.Field.Replace("F_", "").Replace("f_", "").ToPascalCase(),
                        IsIdentity = table.Identity == null ? false : true,
                        IsPrimaryKey = table.PrimaryKey == 1 ? true : false,
                        ColumnType = table.DataType,
                        IsNullable = table.AllowNull == 1 ? false : true,
                        Comments = table.FieldName,
                        CSharpType = GetCSharpType(table.DataType),
                        ColumnLength = table.DataLength.ToLong()
                    };
                    tableColumns.Add(column);
                }
                var alias = relation.table.ToPascalCase();
                var dbTable = new DbTable()
                {
                    TableName = relation.table,
                    Alias = alias.LowerFirstChar(),
                    TableComment = relation.tableName,
                    Columns = tableColumns
                };
                var tableComment = dbTable.TableComment;
                Instance.GenerateEntity(dbTable, true);

                //获取子表列表
                var childTable = tableRelation.Where(t => t.relationTable != "").ToList();

                //主表处理逻辑
                if (relation.relationTable == "")
                {
                    //功能开关
                    var funcSwitch = new List<CodeGeneratorFuncSwitchModel>();
                    funcSwitch.Add(new CodeGeneratorFuncSwitchModel()
                    {
                        funcSwitch = "info",
                        tableRelationTag = relation.relationTable == "" ? 0 : 1,
                        relationField = relation.tableField
                    });
                    funcSwitch.Add(new CodeGeneratorFuncSwitchModel()
                    {
                        funcSwitch = "save",
                        tableRelationTag = relation.relationTable == "" ? 0 : 1,
                        relationField = relation.tableField
                    });
                    funcSwitch.Add(new CodeGeneratorFuncSwitchModel()
                    {
                        funcSwitch = "submit",
                        tableRelationTag = relation.relationTable == "" ? 0 : 1,
                        relationField = relation.tableField
                    });

                    //获取主表主键
                    var columnPrimary = dbTable.Columns.ToList().Find(c => c.IsPrimaryKey);
                    //生成前端Index界面
                    Instance.GenerateVueFlowForm(dbTable.Alias, columnPrimary.Alias, module + "/" + dbTable.Alias, GenerateFlowFormControls(tableForm), GenerateFormDataParameter(tableRelation), GenerateFormDataOptions(), GenerateDataInitMethods(tableRelation), GenerateDataListInitMethods(), GeneratorFormTableColumn(), GenerateDictionaryDataCreated(), GenerateDictionaryDataMethods(), GeneratorFormValidation(), GetFixedFieldList());
                    //生成APP端Form界面

                    //补充固定字段
                    var fixedFieldList = GetFixedFieldList();
                    //创建输入
                    var modelFileName = dbTable.Alias + "CrInput";
                    dbTable.TableComment = string.Format("新建{0}输入", tableComment);
                    var createList = new List<DbTableColumn>();
                    foreach (var item in tableColumns)
                    {
                        var columnName = GeneratorFormDataList.Find(f => f.Model == (item.Alias.LowerFirstChar()));
                        if (columnName != null)
                        {
                            createList.Add(item);
                        }
                    }
                    dbTable.Columns = createList;
                    //补充子表字段
                    var childTableName = new List<string>();
                    if (childTable.Count > 0)
                    {
                        childTable.ForEach(c =>
                        {
                            var tableName = c.table.ToPascalCase();
                            childTableName.Add(tableName.LowerFirstChar());
                        });
                    }
                    Instance.GenerateModelEntity(dbTable, modelFileName, childTableName, fixedFieldList, GeneratorFormDataList, false, true);

                    //修改输出
                    modelFileName = dbTable.Alias + "UpOutput";
                    dbTable.TableComment = string.Format("{0}信息输出", tableComment);
                    //添加主键
                    dbTable.Columns.Add(columnPrimary);
                    Instance.GenerateModelEntity(dbTable, modelFileName, childTableName, fixedFieldList, GeneratorFormDataList, false, true);
                    //修改输出
                    modelFileName = dbTable.Alias + "UpInput";
                    dbTable.TableComment = string.Format("{0}信息输入", tableComment);
                    Instance.GenerateModelEntity(dbTable, modelFileName, childTableName, fixedFieldList, GeneratorFormDataList, false, true);

                    //生成API控制器
                    Instance.GenerateApiFlowController(funcSwitch, module, dbTable.Alias, columnPrimary.Alias, GeneratorFormDataList, childTable, true);
                    funcSwitch.Add(new CodeGeneratorFuncSwitchModel()
                    {
                        funcSwitch = "child",
                        tableRelationTag = relation.relationTable == "" ? 0 : 1,
                        relationField = relation.tableField
                    });

                    //补充子表数据
                    var childLsit = new List<DbTable>();
                    foreach (var item in childTable)
                    {
                        tableList = dataService.GetFieldListByNoAsync(null, item.table);
                        tableColumns = new List<DbTableColumn>();
                        foreach (var table in tableList)
                        {
                            var column = new DbTableColumn()
                            {
                                TableName = relation.table,
                                ColName = table.Field,
                                Alias = table.Field.Replace("F_", "").Replace("f_", "").ToPascalCase(),
                                IsIdentity = table.Identity == null ? false : true,
                                IsPrimaryKey = table.PrimaryKey == 1 ? true : false,
                                ColumnType = table.DataType,
                                IsNullable = table.AllowNull == 1 ? false : true,
                                Comments = table.FieldName,
                                CSharpType = GetCSharpType(table.DataType),
                                ColumnLength = table.DataLength.ToLong()
                            };
                            tableColumns.Add(column);
                        }
                        //剔除表名称第一个_前全部字母
                        alias = item.table.ToPascalCase();
                        var childTables = new DbTable()
                        {
                            TableName = item.table,
                            Alias = alias.LowerFirstChar(),
                            TableComment = item.tableName,
                            Columns = tableColumns
                        };
                        childLsit.Add(childTables);
                    }
                    //生成Bll
                    Instance.GenerateFlowFormBll(funcSwitch, dbTable, GeneratorFormDataList, childLsit, childTable, true);
                    funcSwitch.Remove(funcSwitch.Find(f => f.funcSwitch == "save"));
                    funcSwitch.Remove(funcSwitch.Find(f => f.funcSwitch == "submit"));
                    funcSwitch.Add(new CodeGeneratorFuncSwitchModel()
                    {
                        funcSwitch = "create",
                        tableRelationTag = relation.relationTable == "" ? 0 : 1,
                        relationField = relation.tableField
                    });
                    funcSwitch.Add(new CodeGeneratorFuncSwitchModel()
                    {
                        funcSwitch = "update",
                        tableRelationTag = relation.relationTable == "" ? 0 : 1,
                        relationField = relation.tableField
                    });
                    //生成IService
                    Instance.GenerateFlowFormIService(funcSwitch, dbTable.Alias, childTable, true);
                    //生成Service
                    Instance.GenerateFlowFormService(funcSwitch, dbTable, GeneratorFormDataList, childLsit, childTable, true);
                }
                if (relation.relationTable != "")
                {
                    var modelFileName = dbTable.Alias + "CrInput";
                    dbTable.TableComment = string.Format("{0}创建输入", tableComment);
                    Instance.GenerateModelEntity(dbTable, modelFileName, null, null, GeneratorFormDataList, false, true);
                    modelFileName = dbTable.Alias + "UpInput";
                    dbTable.TableComment = string.Format("{0}创建输入", tableComment);
                    Instance.GenerateModelEntity(dbTable, modelFileName, null, null, GeneratorFormDataList, false, true);
                    modelFileName = dbTable.Alias + "UpOutput";
                    dbTable.TableComment = string.Format("{0}编辑输出", tableComment);
                    Instance.GenerateModelEntity(dbTable, modelFileName, null, null, GeneratorFormDataList, false, true);
                }
            }
        }

        /// <summary>
        /// APP表单模型集合
        /// </summary>
        /// <param name="fileName"></param>
        /// <param name="entity"></param>
        /// <param name="childTb"></param>
        /// <param name="module"></param>
        public void GetAppModelTemplates(string fileName, VisualDevEntity entity, List<string> childTb, string module)
        {
            var tableRelation = entity.Tables.ToObject<List<DbTableRelationModel>>();
            var tableForm = TemplateKeywordsHelper.ReplaceKeywords(entity.FormData).ToObject<FormDataModel>();
            var model = entity.ColumnData.ToObject<ColumnDataModel>();
            Instance.Option.OutputPath = Instance.Option.OutputPath + fileName + @"/Net";
            foreach (var relation in tableRelation)
            {
                var tableList = new List<DbTableFieldModel>();
                tableList = dataService.GetFieldListByNoAsync(null, relation.table);
                var tableColumns = new List<DbTableColumn>();
                foreach (var table in tableList)
                {
                    var column = new DbTableColumn()
                    {
                        TableName = relation.table,
                        ColName = table.Field,
                        Alias = table.Field.Replace("F_", "").Replace("f_", "").ToPascalCase(),
                        IsIdentity = table.Identity == null ? false : true,
                        IsPrimaryKey = table.PrimaryKey == 1 ? true : false,
                        ColumnType = table.DataType,
                        IsNullable = table.AllowNull == 1 ? false : true,
                        Comments = table.FieldName,
                        CSharpType = GetCSharpType(table.DataType),
                        ColumnLength = table.DataLength.ToLong()
                    };
                    tableColumns.Add(column);
                }
                //剔除第一个_前全部字母
                var tableAliasName = relation.table;
                var alias = Regex.Replace(tableAliasName, @"^.*?_", "");
                var dbTable = new DbTable()
                {
                    TableName = relation.table,
                    Alias = alias.Substring(0, 1).ToUpper() + alias.Substring(1),
                    TableComment = relation.tableName,
                    Columns = tableColumns
                };
                var tableComment = dbTable.TableComment;
                Instance.GenerateEntity(dbTable, true);


                // 需要根据模板数据中获取到按钮
                //功能开关
                var funcSwitch = new List<CodeGeneratorFuncSwitchModel>();
                //详情
                funcSwitch.Add(new CodeGeneratorFuncSwitchModel()
                {
                    funcSwitch = "info",
                    tableRelationTag = relation.relationTable == "" ? 0 : 1,
                    relationField = relation.tableField
                });
                //新增
                funcSwitch.Add(new CodeGeneratorFuncSwitchModel()
                {
                    funcSwitch = "add",
                    tableRelationTag = relation.relationTable == "" ? 0 : 1,
                    relationField = relation.tableField
                });
                //编辑
                funcSwitch.Add(new CodeGeneratorFuncSwitchModel()
                {
                    funcSwitch = "edit",
                    tableRelationTag = relation.relationTable == "" ? 0 : 1,
                    relationField = relation.tableField
                });
                //删除
                funcSwitch.Add(new CodeGeneratorFuncSwitchModel()
                {
                    funcSwitch = "remove",
                    tableRelationTag = relation.relationTable == "" ? 0 : 1,
                    relationField = relation.tableField
                });
                if (model.hasPage)
                {
                    funcSwitch.Add(new CodeGeneratorFuncSwitchModel()
                    {
                        funcSwitch = "Page",
                        tableRelationTag = relation.relationTable == "" ? 0 : 1,
                        relationField = relation.tableField
                    });
                }
                else
                {
                    funcSwitch.Add(new CodeGeneratorFuncSwitchModel()
                    {
                        funcSwitch = "noPage",
                        tableRelationTag = relation.relationTable == "" ? 0 : 1,
                        relationField = relation.tableField
                    });
                }
                var searchList = new List<DbTableColumn>();
                var childTable = tableRelation.Where(t => t.relationTable != "").ToList();
                //主表处理逻辑
                if (relation.relationTable == "")
                {
                    var columnPrimary = dbTable.Columns.ToList().Find(c => c.IsPrimaryKey);
                    //生成APP前端Form界面
                    Instance.GenerateVueAppForm(dbTable.Alias.ToPascalCase().LowerFirstChar(), columnPrimary.Alias, module + "/" + dbTable.Alias, GenerateAppFormControlsMainBody(tableForm), GenerateAppFormDataParameter(), GenerateAppFormControlsDirectory(), GenerateAppFormControlsParameterName(), GenerateAppChildreFormDataParameter(tableRelation), GenerateAppFormDataOptions());
                    //生成Bll
                    Instance.GenerateBll(funcSwitch, dbTable, GeneratorFormDataList, true);

                    //创建输入
                    var modelFileName = dbTable.Alias + "CrInput";
                    dbTable.TableComment = string.Format("新建{0}输入", tableComment);
                    var createList = new List<DbTableColumn>();
                    foreach (var item in tableColumns)
                    {
                        var columnName = GeneratorFormDataList.Find(f => f.vModel == (item.ColName.Replace("F_", "").Replace("f_", "").ToPascalCase().LowerFirstChar()));
                        if (columnName != null)
                        {
                            createList.Add(item);
                        }
                    }
                    dbTable.Columns = createList;
                    var childTableName = new List<string>();
                    if (childTable.Count > 0)
                    {
                        childTable.ForEach(c =>
                        {
                            var tableName = c.table.Split('_')[1];
                            childTableName.Add(tableName.Substring(0, 1).ToUpper() + tableName.Substring(1));
                        });
                    }
                    Instance.GenerateModelEntity(dbTable, modelFileName, childTableName, null, null, false, true);

                    //生成Input实体类
                    tableColumns.ForEach(t =>
                    {
                        model.searchList.ForEach(s =>
                        {
                            if (s.__vModel__ == t.ColName)
                            {
                                searchList.Add(t);
                            }
                        });
                    });
                    dbTable.Columns = searchList;
                    //查询列表输入
                    modelFileName = dbTable.Alias + "ListQueryInput";
                    dbTable.TableComment = string.Format("{0}查询列表输入", tableComment);
                    Instance.GenerateModelEntity(dbTable, modelFileName, null, null, null, true, true);
                    //生成Output实体类
                    var columnList = new List<DbTableColumn>();
                    columnList.Add(tableColumns.Find(t => t.IsPrimaryKey == true));
                    tableColumns.ForEach(t =>
                    {
                        var columnName = GeneratorFormDataList.Where(f => f.vModel == (t.ColName.Replace("F_", "").Replace("f_", "").ToLower())).FirstOrDefault();
                        if (columnName != null)
                        {
                            t.IsMultiple = columnName.multiple;
                            columnList.Add(t);
                        }
                    });
                    dbTable.Columns = columnList;
                    //信息输出
                    modelFileName = dbTable.Alias + "UpOutput";
                    dbTable.TableComment = string.Format("{0}信息输出", tableComment);
                    Instance.GenerateModelEntity(dbTable, modelFileName, childTableName, null, null, false, true);

                    columnList = new List<DbTableColumn>();
                    columnList.Add(tableColumns.Find(t => t.IsPrimaryKey == true));
                    tableColumns.ForEach(t =>
                    {
                        model.columnList.ForEach(c =>
                        {
                            if (c.prop == t.ColName)
                            {
                                columnList.Add(t);
                            }
                        });
                    });
                    dbTable.Columns = columnList;
                    //查询列表输出
                    modelFileName = dbTable.Alias + "ListOutput";
                    dbTable.TableComment = string.Format("{0}列表输出", tableComment);
                    Instance.GenerateModelEntity(dbTable, modelFileName, childTableName, null, GeneratorFormDataList, false, true);
                    //生成APIController
                    Instance.GenerateApiController(funcSwitch, module, dbTable, GeneratorFormDataList, childTable, true);
                    //生成IService
                    Instance.GenerateIService(funcSwitch, dbTable.Alias, true);
                    //生成Service
                    Instance.GenerateService(funcSwitch, searchList, GeneratorFormDataList, dbTable, null, null, true);
                }
                //if (relation.relationTable != "")
                //{
                //    //生成Bll
                //    Instance.GenerateBll(funcSwitch, dbTable, GeneratorFormDataList, true);
                //    var tableName = relation.table.Split('_')[1];
                //    var chlidTableFileName = tableName.Substring(0, 1).ToUpper() + tableName.Substring(1) + "CrInput";
                //    //生成子表创建输入出
                //    var chlidtableColumn = GeneratorFormTableColumnList.Where(f => f.Key.Contains(tableName)).FirstOrDefault();
                //    var columnList = new List<DbTableColumn>();
                //    if (!default(KeyValuePair<string, object>).Equals(chlidtableColumn))
                //    {
                //        tableColumns.ForEach(t =>
                //        {
                //            var columnName = (chlidtableColumn.Value as List<string>).FindAll(f => f == (t.ColName.Replace("F_", "").ToLower())).FirstOrDefault();
                //            if (columnName != null)
                //            {
                //                columnList.Add(t);
                //            }
                //        });
                //        dbTable.Columns = columnList;
                //        var modelFileName = dbTable.Alias + "CrInput";
                //        dbTable.TableComment = string.Format("{0}创建输入", tableComment);
                //        Instance.GenerateModelEntity(dbTable, modelFileName, null, null, GeneratorFormDataList, false, true);
                //        modelFileName = dbTable.Alias + "UpOutput";
                //        dbTable.TableComment = string.Format("{0}编辑输出", tableComment);
                //        Instance.GenerateModelEntity(dbTable, modelFileName, null, null, GeneratorFormDataList, false, true);
                //    }

                //    //生成IService
                //    Instance.GenerateIService(funcSwitch, dbTable.Alias, true);
                //    //生成Service
                //    Instance.GenerateService(funcSwitch, searchList, GeneratorFormDataList, dbTable, true);
                //}
            }
        }

        /// <summary>
        /// 获取数据类型
        /// </summary>
        /// <param name="dataType"></param>
        /// <returns></returns>
        private string GetCSharpType(string dataType)
        {
            string CSharpType = string.Empty;
            if ("bigint".IndexOf(dataType) >= 0)
            {
                CSharpType = "int";
            }
            else if ("binary,image,varbinary(max),rowversion,timestamp,varbinary".IndexOf(dataType) >= 0)
            {
                CSharpType = "int";
            }
            else if ("bit".IndexOf(dataType) > 0)
            {
                CSharpType = "int";
            }
            else if ("char,nchar,text,ntext,varchar,nvarchar,xml".IndexOf(dataType) >= 0)
            {
                CSharpType = "string";
            }
            else if ("date,datetime,datetime2,smalldatetime".IndexOf(dataType) >= 0)
            {
                CSharpType = "DateTime";
            }
            else if ("datetimeoffset".IndexOf(dataType) >= 0)
            {
                CSharpType = "DateTime";
            }
            else if (dataType.Contains("decimal") || dataType.Contains("money") || dataType.Contains("numeric") || dataType.Contains("smallmoney"))
            {
                CSharpType = "decimal";
            }
            else if ("float".IndexOf(dataType) >= 0)
            {
                CSharpType = "double";
            }
            else if ("int".IndexOf(dataType) >= 0)
            {
                CSharpType = "int";
            }
            else if ("real".IndexOf(dataType) >= 0)
            {
                CSharpType = "Single";
            }
            else if ("smallint".IndexOf(dataType) >= 0)
            {
                CSharpType = "int";
            }
            else if ("sql_variant".IndexOf(dataType) >= 0)
            {
                CSharpType = "object";
            }
            else if ("time".IndexOf(dataType) >= 0)
            {
                CSharpType = "DataTime";
            }
            else if ("tinyint".IndexOf(dataType) >= 0)
            {
                CSharpType = "byte";
            }
            else if ("uniqueidentifier".IndexOf(dataType) >= 0)
            {
                CSharpType = "Guid";
            }
            return CSharpType;
        }

        /// <summary>
        /// 预览代码
        /// </summary>
        /// <param name="codePath"></param>
        public List<Dictionary<string, object>> priviewCode(string codePath)
        {
            var dataList = FileHelper.GetAllFiles(codePath);
            List<Dictionary<string, string>> datas = new List<Dictionary<string, string>>();
            List<Dictionary<string, object>> allDatas = new List<Dictionary<string, object>>();
            foreach (var item in dataList)
            {
                Dictionary<string, string> data = new Dictionary<string, string>();
                FileStream fileStream = new FileStream(item.FullName, FileMode.Open);
                using (StreamReader reader = new StreamReader(fileStream))
                {
                    var buffer = new Char[(int)reader.BaseStream.Length];
                    reader.Read(buffer, 0, (int)reader.BaseStream.Length);
                    var content = new string(buffer);
                    if ("cs".Equals(item.Extension.Replace(".", "")))
                    {
                        string fileName = item.FullName.ToLower();
                        if (fileName.Contains("entity") || fileName.Contains("listquery") || fileName.Contains("crinput") || fileName.Contains("upinput") || fileName.Contains("upoutput") || fileName.Contains("listoutput"))
                        {
                            data.Add("folderName", "model");
                        }
                        else
                        {
                            data.Add("folderName", "dotnet");
                        }
                        data.Add("fileName", item.Name);
                        //剔除"\0"特殊符号
                        data.Add("fileContent", content.Replace("\0", ""));
                        data.Add("fileType", item.Extension.Replace(".", ""));
                        datas.Add(data);
                    }
                    else if (".vue".Equals(item.Extension))
                    {
                        data.Add("folderName", "vue");
                        data.Add("fileName", item.Name);
                        //剔除"\0"特殊符号
                        data.Add("fileContent", content.Replace("\0", ""));
                        data.Add("fileType", item.Extension.Replace(".", ""));
                        datas.Add(data);
                    }
                }
            }
            //datas 集合去重
            var parent = datas.GroupBy(d => d["folderName"]).Select(d => d.First()).OrderByDescending(d => d["folderName"]).ToList();
            foreach (var item in parent)
            {
                Dictionary<string, object> dataMap = new Dictionary<string, object>();
                dataMap["fileName"] = item["folderName"];
                dataMap["children"] = datas.FindAll(d => d["folderName"] == item["folderName"]);
                allDatas.Add(dataMap);
            }
            return allDatas;
        }

        #region PC前端

        /// <summary>
        /// 生成表单列表页面
        /// </summary>
        /// <param name="models"></param>
        /// <returns></returns>
        public string GenerateIndexPage(ColumnDataModel models, string columnPrimary)
        {
            StringBuilder sb = new StringBuilder();
            sb.AppendLine("\t<div class=\"JNPF-common-layout\">");
            if (models.type == 2)
            {
                sb.AppendLine("\t\t<div class=\"JNPF-common-layout-left\">");
                sb.AppendLine("\t\t\t<div class=\"JNPF-common-title\">");
                sb.AppendLine($"\t\t\t\t<h2>{models.treeTitle}</h2>");
                sb.AppendLine("\t\t\t</div>");
                sb.AppendLine("\t\t\t<el-tree :data=\"treeData\" :props=\"defaultProps\" default-expand-all highlight-current ref=\"treeBox\" :expand-on-click-node=\"false\" @node-click=\"handleNodeClick\" class=\"JNPF-common-el-tree\" node-key=\"id\">");
                sb.AppendLine("\t\t\t\t<span class=\"custom-tree-node\" slot-scope=\"{node,data}\">");
                sb.AppendLine("\t\t\t\t\t<i :class=\"data.icon\"></i>");
                sb.AppendLine("\t\t\t\t\t<span class=\"text\">{{node.label}}</span>");
                sb.AppendLine("\t\t\t\t</span>");
                sb.AppendLine("\t\t\t</el-tree>");
                sb.AppendLine("\t\t</div>");
            }
            sb.AppendLine("\t\t<div class=\"JNPF-common-layout-center\">");
            sb.AppendLine("\t\t\t<el-row class=\"JNPF-common-search-box\" :gutter=\"16\">");
            sb.AppendLine("\t\t\t\t<el-form @submit.native.prevent>");
            var searchList = models.searchList;
            var searchNum = 0;
            foreach (var item in searchList)
            {
                if (searchNum == 3)
                {
                    sb.AppendLine("\t\t<template v-if=\"showAll\">");
                }
                var model = item.__vModel__.Replace("F_", "").Replace("f_", "").ToPascalCase();
                var column = GeneratorFormDataList.Find(c => c.vModel == model);
                var tag = item.__config__.tag;
                var clearable = item.clearable ? "clearable " : "";
                var format = column.format != null ? $"format=\"{column.format}\" type=\"{column.dateType}\" " : "";
                sb.AppendLine("\t\t\t\t\t<el-col :span=\"6\">");
                sb.AppendLine($"\t\t\t\t\t\t<el-form-item label=\"{item.__config__.label}\">");
                var queryControls = ListQueryControlsType.Where(q => q.Value.Contains(column.jnpfKey)).FirstOrDefault();
                if (queryControls.Key != null)
                {
                    foreach (KeyValuePair<string, List<string>> items in ListQueryControlsType)
                    {
                        var controlsType = items.Value.Contains(column.jnpfKey);
                        if (controlsType)
                        {
                            switch (items.Key)
                            {
                                case "inputList":
                                    sb.AppendLine($"\t\t\t\t\t\t\t<el-input v-model=\"query.{column.Model}\" placeholder=\"{item.__config__.label}\" {clearable} />");
                                    break;
                                case "dateList":
                                    sb.AppendLine($"\t\t\t\t\t\t\t<el-date-picker v-model=\"query.{column.Model}\" placeholder=\"选择时间\" format=\"yyyy-MM-dd\" />");
                                    break;
                                case "selectList":
                                    sb.AppendLine($"\t\t\t\t\t\t\t<el-select v-model=\"query.{column.Model}\" placeholder=\"{item.__config__.label}\" {clearable}>");
                                    sb.AppendLine($"\t\t\t\t\t\t\t\t<el-option v-for=\"(item, index) in {model.LowerFirstChar() + "Options"}\" :key=\"index\" :label=\"item.{column.props.label}\" :value=\"item.{column.props.value}\"  />");
                                    sb.AppendLine($"\t\t\t\t\t\t\t</el-select>");
                                    break;
                            }
                        }
                    }
                }
                else
                {
                    sb.AppendLine($"\t\t\t\t\t\t\t<{tag} v-model=\"query.{column.Model}\" placeholder=\"{item.__config__.label}\" {clearable}{format} />");
                }
                sb.AppendLine("\t\t\t\t\t\t</el-form-item>");
                sb.AppendLine("\t\t\t\t\t</el-col>");
                searchNum++;
            }
            if (searchNum >= 4)
            {
                sb.AppendLine("\t\t</template>");
            }
            sb.AppendLine("\t\t\t\t\t<el-col :span=\"6\">");
            sb.AppendLine("\t\t\t\t\t<el-form-item>");
            sb.AppendLine("\t\t\t\t\t\t<el-button type=\"primary\" icon=\"el-icon-search\" @click=\"search()\">查询</el-button>");
            sb.AppendLine("\t\t\t\t\t\t<el-button icon=\"el-icon-refresh-right\" @click=\"reset()\">重置</el-button>");
            if (models.searchList.Count >= 4)
            {
                sb.AppendLine("\t\t\t\t\t\t<el-button type=\"text\" icon=\"el-icon-arrow-down\" @click=\"showAll=true\" v-if=\"!showAll\">展开</el-button>");
                sb.AppendLine("\t\t\t\t\t\t<el-button type=\"text\" icon=\"el-icon-arrow-up\" @click=\"showAll=false\" v-else=\"\">收起</el-button>");
            }
            sb.AppendLine("\t\t\t\t\t</el-form-item>");
            sb.AppendLine("\t\t\t\t\t</el-col>");
            sb.AppendLine("\t\t\t\t</el-form>");
            sb.AppendLine("\t\t\t</el-row>");
            sb.AppendLine("\t\t\t<div class=\"JNPF-common-layout-main JNPF-flex-main\">");
            sb.AppendLine("\t\t\t\t<div class=\"JNPF-common-head\">");
            sb.AppendLine("\t\t\t\t\t<div>");
            int i = 0;
            foreach (var item in models.btnsList)
            {
                string method = string.Empty;
                switch (item.value)
                {
                    case "add":
                        method = "addOrUpdateHandle()";
                        break;
                    case "download":
                        method = "exportData()";
                        break;
                }
                sb.AppendLine($"\t\t\t\t\t\t<el-button type=\"{string.Format("{0}", i == 0 ? "primary" : "text")}\" icon=\"{item.icon}\" @click=\"{method}\">");
                sb.AppendLine($"\t\t\t\t\t\t\t{item.label}");
                sb.AppendLine("\t\t\t\t\t\t</el-button>");
                i++;
            }
            sb.AppendLine("\t\t\t\t\t</div>");
            sb.AppendLine("\t\t\t\t\t<div class=\"JNPF-common-head-right\">");
            sb.AppendLine("\t\t\t\t\t\t<el-tooltip effect=\"dark\" content=\"刷新\" placement=\"top\">");
            sb.AppendLine("\t\t\t\t\t\t\t<el-link icon=\"icon-ym icon-ym-Refresh JNPF-common-head-icon\" :underline=\"false\"  @click=\"reset()\" />");
            sb.AppendLine("\t\t\t\t\t\t</el-tooltip>");
            sb.AppendLine("\t\t\t\t\t\t<screenfull :isContainer=\"true\" />");
            sb.AppendLine("\t\t\t\t\t\t<el-tooltip effect=\"dark\" content=\"列设置\" placement=\"top\">");
            sb.AppendLine("\t\t\t\t\t\t\t<el-link icon=\"icon-ym icon-ym-options JNPF-common-head-icon\" :underline=\"false\" />");
            sb.AppendLine("\t\t\t\t\t\t</el-tooltip>");
            sb.AppendLine("\t\t\t\t\t</div>");
            sb.AppendLine("\t\t\t\t</div>");
            sb.AppendLine("\t\t\t\t<JNPF-table v-loading=\"listLoading\" :data=\"list\">");
            foreach (var item in models.columnList)
            {
                var param = item.prop.Replace("F_", "").Replace("f_", "").ToPascalCase();
                var column = GeneratorFormDataList.Find(c => c.vModel == param);
                switch (column.jnpfKey)
                {
                    case "select":
                        {
                            sb.AppendLine($"\t\t\t\t\t<el-table-column label=\"{item.label}\" {string.Format("{0}", item.width == null ? "" : "width=\"" + item.width + "\"")} prop=\"{column.Model}\" algin=\"{item.align}\">");
                            sb.AppendLine($"\t\t\t\t\t\t<template slot-scope=\"scope\">{{{{ scope.row.{column.Model} | dynamicText({column.Model}Options) }}}}</template>");
                            sb.AppendLine("\t\t\t\t\t</el-table-column>");
                        }
                        break;
                    case "radio":
                        {
                            sb.AppendLine($"\t\t\t\t\t<el-table-column label=\"{item.label}\" {string.Format("{0}", item.width == null ? "" : "width=\"" + item.width + "\"")} prop=\"{column.Model}\" algin=\"{item.align}\">");
                            sb.AppendLine($"\t\t\t\t\t\t<template slot-scope=\"scope\">{{{{ scope.row.{column.Model} | dynamicText({column.Model}Options) }}}}</template>");
                            sb.AppendLine("\t\t\t\t\t</el-table-column>");
                        }
                        break;
                    case "checkbox":
                        {
                            sb.AppendLine($"\t\t\t\t\t<el-table-column label=\"{item.label}\" {string.Format("{0}", item.width == null ? "" : "width=\"" + item.width + "\"")} prop=\"{column.Model}\" algin=\"{item.align}\">");
                            sb.AppendLine($"\t\t\t\t\t\t<template slot-scope=\"scope\">{{{{ scope.row.{column.Model} | dynamicText({column.Model}Options) }}}}</template>");
                            sb.AppendLine("\t\t\t\t\t</el-table-column>");
                        }
                        break;
                    case "treeSelect":
                        {
                            sb.AppendLine($"\t\t\t\t\t<el-table-column label=\"{item.label}\" {string.Format("{0}", item.width == null ? "" : "width=\"" + item.width + "\"")} prop=\"{column.Model}\" algin=\"{item.align}\">");
                            sb.AppendLine($"\t\t\t\t\t\t<template slot-scope=\"scope\">{{{{ scope.row.{column.Model} | dynamicTreeText({column.Model}Options) }}}}</template>");
                            sb.AppendLine("\t\t\t\t\t</el-table-column>");
                        }
                        break;
                    case "cascader":
                        {
                            sb.AppendLine($"\t\t\t\t\t<el-table-column label=\"{item.label}\" {string.Format("{0}", item.width == null ? "" : "width=\"" + item.width + "\"")} prop=\"{column.Model}\" algin=\"{item.align}\">");
                            sb.AppendLine($"\t\t\t\t\t\t<template slot-scope=\"scope\">{{{{ scope.row.{column.Model} | dynamicTreeText({column.Model}Options) }}}}</template>");
                            sb.AppendLine("\t\t\t\t\t</el-table-column>");
                        }
                        break;
                    default:
                        {
                            sb.AppendLine($"\t\t\t\t\t<el-table-column prop=\"{column.Model}\" label=\"{item.label}\" align=\"{item.align}\" {string.Format("{0}", item.width == null ? "" : "width=\"" + item.width + "\"")}/>");
                        }
                        break;
                }
            }
            sb.AppendLine($"\t\t\t\t\t<el-table-column label=\"操作\" fixed=\"right\" width=\"{50 * models.columnBtnsList.Count}\">");
            sb.AppendLine("\t\t\t\t\t\t<template slot-scope=\"scope\">");
            foreach (var item in models.columnBtnsList)
            {
                string method = string.Empty;
                switch (item.value)
                {
                    case "edit":
                        method = $"addOrUpdateHandle(scope.row.{columnPrimary.ToLower()})";
                        break;
                    case "remove":
                        method = $"handleDel(scope.row.{columnPrimary.ToLower()})";
                        break;
                    case "detail":
                        method = $"addOrUpdateHandle(scope.row.{columnPrimary.ToLower()},true)";
                        break;
                }
                sb.AppendLine($"\t\t\t\t\t\t\t<el-button type=\"text\" @click=\"{method}\" {string.Format("{0}", item.value == "remove" ? "class=\"JNPF-table-delBtn\"" : "")}>");
                sb.AppendLine($"\t\t\t\t\t\t\t\t{item.label}");
                sb.AppendLine("\t\t\t\t\t\t\t</el-button>");
            }
            sb.AppendLine("\t\t\t\t\t\t</template>");
            sb.AppendLine("\t\t\t\t\t</el-table-column>");
            sb.AppendLine("\t\t\t\t</JNPF-table>");
            string pagination = string.Empty;
            pagination = "\t\t\t\t<pagination :total=\"total\" :page.sync=\"listQuery.currentPage\" :limit.sync=\"listQuery.pageSize\" @pagination=\"initData\" />";
            sb.AppendLine($"{string.Format("{0}", models.hasPage ? pagination : "")}");
            sb.AppendLine("\t\t\t</div>");
            sb.AppendLine("\t\t</div>");
            sb.AppendLine("\t\t<JNPF-Form v-if=\"formVisible\" ref=\"JNPFForm\" @refresh=\"refresh\" />");
            sb.AppendLine("\t\t<ExportBox v-if=\"exportBoxVisible\" ref=\"ExportBox\" @download=\"download\" />");
            sb.AppendLine("\t</div>");
            return sb.ToString();
        }

        /// <summary>
        /// 生成分页查询参数
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public string GenerateQueryParameter(ColumnDataModel model)
        {
            StringBuilder sb = new StringBuilder();
            foreach (var item in model.searchList)
            {
                var param = item.__vModel__.Replace("F_", "").Replace("f_", "").ToPascalCase().LowerFirstChar();
                sb.AppendLine($"\t\t\t\t\t{param}:undefined,");
            }
            //查询左侧树是否存在查询列表内
            if (!model.searchList.Select(p => p.__vModel__ == model.treeDbTableFieldRelation).ToBool() && model.type == 2)
            {
                var param = model.treeDbTableFieldRelation.Replace("F_", "").Replace("f_", "").ToPascalCase().LowerFirstChar();
                sb.AppendLine($"\t\t\t\t\t{param}:undefined,");
            }
            return sb.ToString();
        }

        /// <summary>
        /// 生成分页参数
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public string GenerateHasPageParameter(ColumnDataModel model)
        {
            StringBuilder sb = new StringBuilder();
            if (model.hasPage)
            {
                sb.AppendLine("\t\t\t\t\tcurrentPage: 1,");
                sb.AppendLine("\t\t\t\t\tpageSize: 20,");
            }
            return sb.ToString();
        }

        /// <summary>
        /// 生成列表列数据
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public string GenerateDataColumnList(ColumnDataModel model)
        {
            StringBuilder sb = new StringBuilder();
            foreach (var item in model.columnList)
            {
                var param = item.prop.Replace("F_", "").Replace("f_", "").ToPascalCase().LowerFirstChar();
                sb.Append("\t\t\t\t\t{");
                sb.Append($"prop: '{param}', label: '{item.label}'");
                sb.Append("},\r\n");
            }
            return sb.ToString();
        }

        /// <summary>
        /// 生成表单控件
        /// </summary>
        /// <param name="form"></param>
        /// <returns></returns>
        public async Task<string> GenerateFormControls(FormDataModel form)
        {
            GeneratorFormDataList = new List<GeneratorFormColumn>();
            GeneratorFormDataOptionsList = new Dictionary<string, object>();
            StringBuilder sb = new StringBuilder();
            StringBuilder popupType = new StringBuilder();
            sb.AppendLine($"\t\t\t<el-form ref=\"{form.formRef}\" :model=\"{form.formModel}\" size=\"{form.size}\" label-width=\"{form.labelWidth}px\" label-position=\"{form.labelPosition}\" :disabled=\"!!isDetail\" :rules=\"rules\">");
            foreach (var item in form.fields)
            {
                var config = item.__config__;
                switch (config.jnpfKey)
                {
                    //栅格布局
                    case "row":
                        {
                            sb.AppendLine($"\t\t\t\t<el-col :span=\"{config.span}\">");
                            sb.AppendLine($"\t\t\t\t\t<el-row :gutter=\"{form.gutter}\">");
                            sb.AppendFormat("{0}", GenerateFormChildrenControls(config.children, form.gutter));
                            sb.AppendLine("\t\t\t\t\t</el-row>");
                            sb.AppendLine("\t\t\t\t</el-col>");
                        }
                        break;
                    //表格
                    case "table":
                        {
                            sb.AppendLine($"\t\t\t\t<el-col :span=\"{config.span}\">");
                            sb.AppendLine("\t\t\t\t\t<el-form-item label-width=\"0\">");
                            if (config.showTitle)
                            {
                                sb.AppendLine("\t\t\t\t\t\t<div class=\"JNPF-common-title\">");
                                sb.AppendLine($"\t\t\t\t\t\t\t<h2>{config.label}</h2>");
                                sb.AppendLine("\t\t\t\t\t\t</div>");
                            }
                            var tableAliasName = item.__config__.tableName.ToPascalCase();
                            sb.AppendLine($"\t\t\t\t\t\t\t<el-table :data=\"dataForm.{tableAliasName.LowerFirstChar()}\" size='mini'>");
                            sb.AppendLine("\t\t\t\t\t\t\t\t<el-table-column type=\"index\" width=\"50\" label=\"序号\" align=\"center\" />");
                            List<string> FormTableColumn = new List<string>();
                            foreach (var children in config.children)
                            {
                                var childrenConfig = children.__config__;
                                var chilModel = children.__vModel__.Replace("F_", "").Replace("f_", "").ToPascalCase();
                                var vModel = chilModel.LowerFirstChar();
                                FormTableColumn.Add(chilModel);

                                var style = children.style != null ? $":style='{children.style.ToJson()}'" : "";
                                var placeholder = item.placeholder != null ? $"placeholder=\"{item.placeholder}\" " : "";
                                var clearable = children.clearable ? "clearable " : "";
                                var @readonly = children.@readonly ? "readonly " : "";
                                var disabled = children.disabled ? "disabled " : "";
                                var show_word_limit = children.showwordlimit ? "show-word-limit " : "";
                                var type = children.type != null ? $"type=\"{children.type}\" " : "";
                                var format = children.format != null ? $"format=\"{children.format}\" " : "";
                                var valueFormat = children.valueformat != null ? $"value-format=\"{children.valueformat}\" " : "";
                                var autosize = children.autosize != null ? $":autosize='{children.autosize.ToJson()}' " : "";
                                var multiple = children.multiple ? $":multiple=\"{children.multiple}\" " : "";
                                var size = children.__config__.optionType != null ? (children.__config__.optionType == "default" ? "" : $"size=\"{children.size}\" ") : "";

                                sb.AppendLine($"\t\t\t\t\t\t\t\t<el-table-column prop=\"{vModel}\" label=\"{children.__config__.label}\">");
                                sb.AppendLine("\t\t\t\t\t\t\t\t\t<template slot-scope=\"scope\">");
                                switch (children.__config__.jnpfKey)
                                {
                                    case "select":
                                        {
                                            var props = children.__config__.props;
                                            sb.AppendLine($"\t\t\t\t\t\t\t\t\t\t<{childrenConfig.tag} v-model=\"scope.row.{vModel}\" {style}{placeholder}{clearable}{@readonly}{disabled} {multiple}>");
                                            sb.AppendLine($"\t\t\t\t\t\t\t\t\t\t\t<el-option v-for=\"(item, index) in {vModel + "Options"}\" :key=\"index\" :label=\"item.{props.label}\" :value=\"item.{props.value}\" :disabled=\"item.disabled\"></el-option>");
                                            sb.AppendLine($"\t\t\t\t\t\t\t\t\t\t</{childrenConfig.tag}>");
                                            switch (children.__config__.dataType)
                                            {
                                                case "static":
                                                    GeneratorFormDataOptionsList[vModel + "Options"] = children.__slot__.options;
                                                    break;
                                                default:
                                                    GeneratorFormDataOptionsList[vModel + "Options"] = null;
                                                    break;
                                            }
                                        }
                                        break;
                                    default:
                                        {
                                            sb.AppendLine($"\t\t\t\t\t\t\t\t\t\t<{childrenConfig.tag} v-model=\"scope.row.{vModel}\" {placeholder}{clearable}{size}{@readonly}{disabled}{show_word_limit}{style}{type}{format}{valueFormat}{autosize}{multiple}></{childrenConfig.tag}>");
                                        }
                                        break;
                                }
                                sb.AppendLine("\t\t\t\t\t\t\t\t\t</template>");
                                sb.AppendLine("\t\t\t\t\t\t\t\t</el-table-column>");
                            }
                            GeneratorFormTableColumnList[tableAliasName.LowerFirstChar() + "EntityList"] = FormTableColumn;
                            sb.AppendLine("\t\t\t\t\t\t\t\t<el-table-column label=\"操作\" width=\"50\">");
                            sb.AppendLine("\t\t\t\t\t\t\t\t\t<template slot-scope=\"scope\">");
                            sb.AppendLine($"\t\t\t\t\t\t\t\t\t\t<el-button size=\"mini\" type=\"text\" class=\"JNPF-table-delBtn\" @click=\"handleDel{tableAliasName}EntityList(scope.$index)\">删除</el-button>");
                            sb.AppendLine("\t\t\t\t\t\t\t\t\t</template>");
                            sb.AppendLine("\t\t\t\t\t\t\t\t</el-table-column>");
                            sb.AppendLine("\t\t\t\t\t\t\t</el-table>");
                            sb.AppendLine($"\t\t\t\t\t\t\t<div class=\"table-actions\" @click=\"addHandle{tableAliasName}EntityList()\">");
                            sb.AppendLine("\t\t\t\t\t\t\t\t<el-button type=\"text\" icon=\"el-icon-plus\">新增</el-button>");
                            sb.AppendLine("\t\t\t\t\t\t\t</div>");
                            sb.AppendLine("\t\t\t\t\t\t</el-form-item>");
                            sb.AppendLine("\t\t\t\t\t</el-col>");
                        }
                        break;
                    //卡片
                    case "card":
                        {
                            sb.AppendLine($"<el-card class=\"mb-20\" shadow=\"{item.shadow}\">");
                            sb.AppendFormat("{0}", GenerateFormChildrenControls(config.children, form.gutter));
                            sb.AppendLine("</el-card>");
                        }
                        break;
                    //分割线
                    case "divider":
                        {
                            sb.AppendLine($"\t\t<el-col :span=\"{config.span}\">");
                            sb.AppendLine("\t\t<el-form-item label-width=\"0\">");
                            sb.AppendLine($"\t\t<el-divider content-position=\"{item.contentposition}\">{item.__slot__.@default}</el-divider>");
                            sb.AppendLine("\t\t</el-form-item>");
                            sb.AppendLine("\t\t</el-col>");
                        }
                        break;
                    //分组标题
                    case "groupTitle":
                        {
                            sb.AppendLine($"\t\t<el-col :span=\"{config.span}\">");
                            sb.AppendLine("\t\t<el-form-item label-width=\"0\">");
                            sb.AppendLine($"\t\t<groupTitle content-position=\"{item.contentposition}\" :content=\"{item.content}\"></groupTitle>");
                            sb.AppendLine("\t\t</el-form-item>");
                            sb.AppendLine("\t\t</el-col>");
                        }
                        break;
                    //文本
                    case "JNPFText":
                        {
                            var textStyle = item.textStyle != null ? $":textStyle=\"{item.textStyle}\" " : "";
                            sb.AppendLine($"\t\t<el-col :span=\"{config.span}\">");
                            sb.AppendLine("\t\t<el-form-item label-width=\"0\">");
                            sb.AppendLine($"\t\t<JNPF-Text :value=\"{item.__config__.defaultValue}\" {textStyle}></JNPF-Text>");
                            sb.AppendLine("\t\t</el-form-item>");
                            sb.AppendLine("\t\t</el-col>");
                        }
                        break;
                    //常规
                    default:
                        {
                            var vModel = string.Empty;
                            var model = string.Empty;

                            var style = item.style != null ? $":style='{item.style.ToJson()}' " : "";
                            var clearable = item.clearable ? "clearable " : "";
                            var @readonly = item.@readonly ? "readonly " : "";
                            var required = config.required ? "required " : "";
                            var placeholder = item.placeholder != null ? $"placeholder=\"{item.placeholder}\" " : "";
                            var disabled = item.disabled ? "disabled " : "";
                            var show_word_limit = item.showwordlimit ? "show-word-limit " : "";
                            var type = !string.IsNullOrEmpty(item.type) ? $"type=\"{item.type}\" " : "";
                            var format = item.format != null ? $"format=\"{item.format}\" " : "";
                            var valueFormat = item.valueformat != null ? $"value-format=\"{item.valueformat}\" " : "";
                            var autosize = item.autosize != null ? $":autosize='{item.autosize.ToJson()}' " : "";
                            var multiple = item.multiple ? $"multiple " : "";
                            var isRange = item.isrange ? "is-range " : "";
                            var props = item.__config__.props;
                            var optionType = item.__config__.optionType == "default" ? "" : "-button";
                            var size = item.__config__.optionType != null ? (item.__config__.optionType == "default" ? "" : $"size=\"{item.size}\" ") : "";
                            var prefixIcon = item.prefixicon != null ? $"prefix-icon=\"{item.prefixicon}\" " : "";
                            var suffixIcon = item.suffixicon != null ? $"suffix-icon=\"{item.suffixicon}\" " : "";
                            var maxlength = item.maxlength != null ? $"maxlength=\"{item.maxlength}\" " : "";
                            var step = item.step != 0 ? $":step=\"{item.step}\" " : "";
                            var stepStrictly = item.stepstrictly ? "step-strictly " : "";
                            var controlsPosition = item.controlsposition != null ? $"controls-position=\"{item.controlsposition}\" " : "";
                            var showChinese = item.showChinese ? "showChinese " : "";
                            var showPassword = item.showPassword ? "show-password " : "";
                            var filterable = item.filterable ? "filterable " : "";
                            var showAllLevels = item.showAllLevels ? "show-all-levels " : "";
                            var separator = item.separator != null ? $"separator=\"{item.separator}\" " : "";
                            var rangeSeparator = item.rangeseparator != null ? $"range-separator=\"{item.rangeseparator}\" " : "";
                            var startPlaceholder = item.startplaceholder != null ? $"start-placeholder=\"{item.startplaceholder}\" " : "";
                            var endPlaceholder = item.endplaceholder != null ? $"end-placeholder=\"{item.endplaceholder}\" " : "";
                            var pickerOptions = item.pickeroptions != null ? $":picker-options='{item.pickeroptions.ToJson()}' " : "";
                            var max = item.max != 0 ? $":max=\"{item.max}\" " : "";
                            var allowHalf = item.allowhalf ? "allow-half " : "";
                            var showText = item.showtext ? $"show-text " : "";
                            var showScore = item.showScore ? $"show-score " : "";
                            var showAlpha = item.showalpha ? $"show-alpha " : "";
                            var colorFormat = item.colorformat != null ? $"color-format=\"{item.colorformat}\" " : "";
                            var activeText = item.activetext != null ? $"active-text=\"{item.activetext}\" " : "";
                            var inactiveText = item.inactivetext != null ? $"inactive-text=\"{item.inactivetext}\" " : "";
                            var activeColor = item.activecolor != null ? $"active-color=\"{item.activecolor}\" " : "";
                            var inactiveColor = item.inactivecolor != null ? $"inactive-color=\"{item.inactivecolor}\" " : "";
                            var isSwitch = item.__config__.jnpfKey == "switch" ? $":active-value=\"{item.activevalue}\" :inactive-value=\"{item.inactivevalue}\" " : "";
                            var min = item.min != 0 ? $":min=\"{item.min}\" " : "";
                            var showStops = item.showstops ? $"show-stops " : "";
                            var range = item.range ? $"range " : "";
                            var accept = item.accept != null ? $"accept=\"{item.accept}\" " : "";
                            var showTip = item.showTip ? $"showTip " : "";
                            var fileSize = item.fileSize != 0 ? $":fileSize=\"{item.fileSize}\" " : "";
                            var sizeUnit = item.sizeUnit != null ? $"sizeUnit=\"{item.sizeUnit}\" " : "";
                            var limit = item.limit != 0 ? $":limit=\"{item.limit}\" " : "";
                            var contentposition = item.contentposition != null ? $"content-position=\"{item.contentposition}\" " : "";
                            var buttonText = item.buttonText != null ? $"buttonText=\"{item.buttonText}\" " : "";
                            var level = item.level != 0 ? $":level=\"{item.level}\" " : "";
                            var actionText = item.actionText != null ? $"actionText=\"{item.actionText}\" " : "";
                            var shadow = item.shadow != null ? $"shadow=\"{item.shadow}\" " : "";
                            var content = item.content != null ? $"content=\"{item.content}\" " : "";
                            var noShow = item.__config__.noShow ? "v-if=\"false\" " : "";

                            if (!string.IsNullOrEmpty(item.__vModel__))
                            {
                                model = item.__vModel__.Replace("F_", "").Replace("f_", "").ToPascalCase();
                                var Model = model.LowerFirstChar();
                                switch (item.__config__.jnpfKey)
                                {
                                    //复选框
                                    case "checkbox":
                                        vModel = $"v-model=\"{Model}\" ";
                                        break;
                                    //下拉框多选
                                    case "select":
                                        if (item.multiple)
                                        {
                                            vModel = $"v-model=\"{Model}\" ";
                                        }
                                        else
                                        {
                                            vModel = $"v-model=\"dataForm.{Model}\" ";
                                        }
                                        break;
                                    //时间范围
                                    case "timeRange":
                                        vModel = $"v-model=\"{Model}\" ";
                                        break;
                                    //日期范围
                                    case "dateRange":
                                        vModel = $"v-model=\"{Model}\" ";
                                        break;
                                    //省市区
                                    case "address":
                                        vModel = $"v-model=\"{Model}\" ";
                                        break;
                                    //上传图片
                                    case "uploadImg":
                                        vModel = $"v-model=\"{Model}List\" ";
                                        break;
                                    //上传文件
                                    case "uploadFz":
                                        vModel = $"v-model=\"{Model}List\" ";
                                        break;
                                    default:
                                        vModel = $"v-model=\"dataForm.{Model}\" ";
                                        break;
                                }
                                GeneratorFormDataList.Add(new GeneratorFormColumn()
                                {
                                    vModel = model,
                                    Model = model.LowerFirstChar(),
                                    jnpfKey = item.__config__.jnpfKey,
                                    dataType = item.__config__.dataType,
                                    dictionaryType = config.dataType == "dictionary" ? item.__config__.dictionaryType : (config.dataType == "dynamic" ? item.__config__.propsUrl : null),
                                    props = item.__config__.props != null ? new Utils.PropsModel()
                                    {
                                        label = item.__config__.props.label,
                                        value = item.__config__.props.value
                                    } : null,
                                    format = item.format,
                                    dateType = item.type,
                                    multiple = item.multiple ? item.multiple : (item.__config__.jnpfKey == "checkbox" ? true : false),
                                    billRule = item.__config__.rule,
                                    required = item.__config__.required,
                                    regList = item.__config__.regList,
                                    placeholder = item.__config__.label,
                                    range = item.range,
                                    defaultValue = item.__config__.defaultValue
                                });
                                model = model.LowerFirstChar();
                            }
                            sb.AppendLine($"\t\t\t\t<el-col :span=\"{config.span}\"{noShow}>");
                            sb.AppendLine($"\t\t\t\t\t<el-form-item label=\"{item.__config__.label}\" prop=\"{model.LowerFirstChar()}\" {required}>");
                            sb.AppendLine($"\t\t\t\t\t\t<{config.tag} {vModel}{placeholder}{clearable}{@readonly}{disabled}{show_word_limit}{isRange}{style}{type}{format}{valueFormat}{autosize}{multiple}{size}{prefixIcon}{suffixIcon}{maxlength}{step}{stepStrictly}{controlsPosition}{showChinese}{showPassword}{filterable}{showAllLevels}{rangeSeparator}{startPlaceholder}{endPlaceholder}{separator}{pickerOptions}{max}{min}{allowHalf}{showText}{showScore}{showAlpha}{colorFormat}{activeText}{inactiveText}{activeColor}{inactiveColor}{isSwitch}{showStops}{range}{accept}{showTip}{fileSize}{sizeUnit}{limit}{contentposition}{buttonText}{level}{actionText}{shadow}{content}>");
                            switch (config.jnpfKey)
                            {
                                case "select":
                                    {
                                        sb.AppendLine($"\t\t\t\t\t\t\t<el-option v-for=\"(item, index) in {model + "Options"}\" :key=\"index\" :label=\"item.{props.label}\" :value=\"item.{props.value}\" ></el-option>");
                                        switch (item.__config__.dataType)
                                        {
                                            //静态数据
                                            case "static":
                                                GeneratorFormDataOptionsList[model + "Options"] = item.__slot__.options;
                                                break;
                                            ////远端数据
                                            //case "dynamic":
                                            //    {
                                            //        DataInterfaceEntity dynamic = await dataInterfaceService.GetInfo(config.propsUrl);
                                            //        if (1.Equals(dynamic.DataType))
                                            //        {
                                            //            var linkEntity = await dbLinkservice.GetInfo(dynamic.DBLinkId);
                                            //            var dt = await dataService.GetInterFaceData(linkEntity, dynamic.Query);
                                            //            List<Dictionary<string, object>> dynamicDataList = UtilConvert.DataTableToDicList(dt);
                                            //            List<Dictionary<string, string>> list = new List<Dictionary<string, string>>();
                                            //            foreach (var items in dynamicDataList)
                                            //            {
                                            //                Dictionary<string, string> dynamicDic = new Dictionary<string, string>();
                                            //                dynamicDic.Add(items[config.props.value].ToString(), items[config.props.label].ToString());
                                            //                list.Add(dynamicDic);
                                            //            }
                                            //            GeneratorFormDataOptionsList[model + "Options"] = list;
                                            //        }
                                            //    }
                                            //    break;
                                            ////数据字典数据
                                            //case "dictionary":
                                            //    {
                                            //        List<DictionaryDataEntity> dictionaryDataEntityList = string.IsNullOrEmpty(config.dictionaryType) ? null : await dictionaryService.GetList(config.dictionaryType);
                                            //        List<Dictionary<string, string>> dictionaryDataList = new List<Dictionary<string, string>>();
                                            //        foreach (var items in dictionaryDataEntityList)
                                            //        {
                                            //            Dictionary<string, string> dictionary = new Dictionary<string, string>();
                                            //            dictionary.Add(items.Id, items.FullName);
                                            //            dictionaryDataList.Add(dictionary);
                                            //        }
                                            //        GeneratorFormDataOptionsList[model + "Options"] = dictionaryDataList;
                                            //    }
                                            //    break;
                                            default:
                                                GeneratorFormDataOptionsList[model + "Options"] = null;
                                                break;
                                        }
                                    }
                                    break;
                                case "radio":
                                    {
                                        sb.AppendLine($"\t\t\t\t\t\t\t<el-radio{optionType} v-for=\"(item, index) in {model + "Options"}\" :key=\"index\" :label=\"item.{props.value}\"  >{{{{item.{props.label}}}}}</el-radio{optionType}>");
                                        switch (item.__config__.dataType)
                                        {
                                            case "static":
                                                GeneratorFormDataOptionsList[model + "Options"] = item.__slot__.options;
                                                break;
                                            ////远端数据
                                            //case "dynamic":
                                            //    {
                                            //        DataInterfaceEntity dynamic = await dataInterfaceService.GetInfo(config.propsUrl);
                                            //        if (1.Equals(dynamic.DataType))
                                            //        {
                                            //            var linkEntity = await dbLinkservice.GetInfo(dynamic.DBLinkId);
                                            //            var dt = await dataService.GetInterFaceData(linkEntity, dynamic.Query);
                                            //            List<Dictionary<string, object>> dynamicDataList = UtilConvert.DataTableToDicList(dt);
                                            //            List<Dictionary<string, string>> list = new List<Dictionary<string, string>>();
                                            //            foreach (var items in dynamicDataList)
                                            //            {
                                            //                Dictionary<string, string> dynamicDic = new Dictionary<string, string>();
                                            //                dynamicDic.Add(items[config.props.value].ToString(), items[config.props.label].ToString());
                                            //                list.Add(dynamicDic);
                                            //            }
                                            //            GeneratorFormDataOptionsList[model + "Options"] = list;
                                            //        }
                                            //    }
                                            //    break;
                                            ////数据字典数据
                                            //case "dictionary":
                                            //    {
                                            //        List<DictionaryDataEntity> dictionaryDataEntityList = string.IsNullOrEmpty(config.dictionaryType) ? null : await dictionaryService.GetList(config.dictionaryType);
                                            //        List<Dictionary<string, string>> dictionaryDataList = new List<Dictionary<string, string>>();
                                            //        foreach (var items in dictionaryDataEntityList)
                                            //        {
                                            //            Dictionary<string, string> dictionary = new Dictionary<string, string>();
                                            //            dictionary.Add(items.Id, items.FullName);
                                            //            dictionaryDataList.Add(dictionary);
                                            //        }
                                            //        GeneratorFormDataOptionsList[model + "Options"] = dictionaryDataList;
                                            //    }
                                            //    break;
                                            default:
                                                GeneratorFormDataOptionsList[model + "Options"] = null;
                                                break;
                                        }
                                    }
                                    break;
                                case "checkbox":
                                    {
                                        sb.AppendLine($"\t\t\t\t\t\t\t<el-checkbox{optionType} v-for=\"(item, index) in {model + "Options"}\" :key=\"index\" :label=\"item.{props.value}\" >{{{{item.{props.label}}}}}</el-checkbox{optionType}>");
                                        switch (item.__config__.dataType)
                                        {
                                            case "static":
                                                GeneratorFormDataOptionsList[model + "Options"] = item.__slot__.options;
                                                break;
                                            ////远端数据
                                            //case "dynamic":
                                            //    {
                                            //        DataInterfaceEntity dynamic = await dataInterfaceService.GetInfo(config.propsUrl);
                                            //        if (1.Equals(dynamic.DataType))
                                            //        {
                                            //            var linkEntity = await dbLinkservice.GetInfo(dynamic.DBLinkId);
                                            //            var dt = await dataService.GetInterFaceData(linkEntity, dynamic.Query);
                                            //            List<Dictionary<string, object>> dynamicDataList = UtilConvert.DataTableToDicList(dt);
                                            //            List<Dictionary<string, string>> list = new List<Dictionary<string, string>>();
                                            //            foreach (var items in dynamicDataList)
                                            //            {
                                            //                Dictionary<string, string> dynamicDic = new Dictionary<string, string>();
                                            //                dynamicDic.Add(items[config.props.value].ToString(), items[config.props.label].ToString());
                                            //                list.Add(dynamicDic);
                                            //            }
                                            //            GeneratorFormDataOptionsList[model + "Options"] = list;
                                            //        }
                                            //    }
                                            //    break;
                                            ////数据字典数据
                                            //case "dictionary":
                                            //    {
                                            //        List<DictionaryDataEntity> dictionaryDataEntityList = string.IsNullOrEmpty(config.dictionaryType) ? null : await dictionaryService.GetList(config.dictionaryType);
                                            //        List<Dictionary<string, string>> dictionaryDataList = new List<Dictionary<string, string>>();
                                            //        foreach (var items in dictionaryDataEntityList)
                                            //        {
                                            //            Dictionary<string, string> dictionary = new Dictionary<string, string>();
                                            //            dictionary.Add(items.Id, items.FullName);
                                            //            dictionaryDataList.Add(dictionary);
                                            //        }
                                            //        GeneratorFormDataOptionsList[model + "Options"] = dictionaryDataList;
                                            //    }
                                            //    break;
                                            default:
                                                GeneratorFormDataOptionsList[model + "Options"] = null;
                                                break;
                                        }
                                    }
                                    break;
                                case "comInput":
                                    {
                                        if (item.__slot__.prepend != null)
                                        {
                                            sb.AppendLine($"\t\t\t\t\t\t\t<template slot=\"prepend\">{item.__slot__.prepend}</template>");
                                        }
                                        if (item.__slot__.append != null)
                                        {
                                            sb.AppendLine($"\t\t\t\t\t\t\t<template slot=\"append\">{item.__slot__.append}</template>");
                                        }
                                    }
                                    break;
                            }
                            sb.AppendLine($"\t\t\t\t\t\t</{config.tag}>");
                            sb.AppendLine("\t\t\t\t\t</el-form-item>");
                            sb.AppendLine("\t\t\t\t</el-col>");
                        }
                        break;
                }
            }
            sb.AppendLine("\t\t\t</el-form>");
            var confirmButtonText = string.IsNullOrEmpty(form.confirmButtonText) ? "取 消" : form.confirmButtonText;
            var cancelButtonText = string.IsNullOrEmpty(form.cancelButtonText) ? "保 存" : form.cancelButtonText;
            //全屏弹窗
            if (form.popupType == "fullScreen")
            {
                popupType.AppendLine("\t<transition name=\"el-zoom-in-center\">");
                popupType.AppendLine("\t\t<div class=\"JNPF-preview-main\">");
                popupType.AppendLine("\t\t\t<div class=\"JNPF-common-page-header\">");
                popupType.AppendLine("\t\t\t\t<el-page-header @back=\"goBack\" :content=\"!dataForm.id ? '新建' : isDetail ? '详情' : '编辑'\"/>");
                popupType.AppendLine("\t\t\t\t<div class=\"options\">");
                popupType.AppendLine($"\t\t\t\t\t<el-button type=\"primary\" @click=\"dataFormSubmit()\" v-if=\"!isDetail\">{confirmButtonText}</el-button>");
                popupType.AppendLine($"\t\t\t\t\t<el-button @click=\"goBack\">{cancelButtonText}</el-button>");
                popupType.AppendLine("\t\t\t\t</div>");
                popupType.AppendLine("\t\t\t</div>");
                var formStyle = string.IsNullOrEmpty(form.formStyle) ? "" : form.formStyle + " ";
                popupType.AppendLine($"\t\t\t<el-row :gutter=\"15\"  class=\"{formStyle}main\" :style=\"{{margin: '0 auto',width:'{form.fullScreenWidth}'}}\">");
                popupType.AppendFormat("{0}", sb.ToString());
                popupType.AppendLine("\t\t\t</el-row>");
                popupType.AppendLine("\t\t</div>");
                popupType.AppendLine("\t</transition>");
            }
            //普通弹窗
            else if (form.popupType == "general")
            {
                popupType.AppendLine($"\t<el-dialog :title=\"!dataForm.id ? '新建' :  isDetail ? '详情':'编辑'\" :close-on-click-modal=\"false\" :visible.sync=\"visible\" class=\"JNPF-dialog JNPF-dialog_center\" lock-scroll width=\"{form.generalWidth}\">");
                popupType.AppendLine($"\t\t<el-row :gutter=\"15\" class=\"{form.formStyle}\" >");
                popupType.AppendFormat("{0}", sb.ToString());
                popupType.AppendLine("\t\t</el-row>");
                popupType.AppendLine("\t\t<span slot=\"footer\" class=\"dialog-footer\">");
                popupType.AppendLine($"\t\t\t<el-button @click=\"visible = false\">{cancelButtonText}</el-button> ");
                popupType.AppendLine($"\t\t\t<el-button type=\"primary\" @click=\"dataFormSubmit()\" v-if=\"!isDetail\">{confirmButtonText}</el-button>");
                popupType.AppendLine("\t\t</span>");
                popupType.AppendLine("\t</el-dialog>");
            }
            return popupType.ToString();
        }

        /// <summary>
        /// 生成表单Children无限级
        /// </summary>
        /// <param name="childrenList"></param>
        /// <param name="gutter"></param>
        /// <returns></returns>
        public string GenerateFormChildrenControls(List<FieldsModel> childrenList, int gutter)
        {
            StringBuilder sb = new StringBuilder();
            foreach (var item in childrenList)
            {
                var config = item.__config__;
                switch (config.jnpfKey)
                {
                    //栅格布局
                    case "row":
                        {
                            sb.AppendLine($"<el-col :span=\"{config.span}\">");
                            sb.AppendLine($"<el-row :gutter=\"{gutter}\">");
                            sb.AppendFormat("{0}", GenerateFormChildrenControls(config.children, gutter));
                            sb.AppendLine("</el-row>");
                            sb.AppendLine("</el-col>");
                        }
                        break;
                    //表格
                    case "table":
                        {
                            sb.AppendLine($"\t<el-col :span=\"{config.span}\">");
                            sb.AppendLine("\t<el-form-item label-width=\"0\">");
                            if (config.showTitle)
                            {
                                sb.AppendLine("<div class=\"JNPF-common-title\">");
                                sb.AppendLine($"<h2>{config.label}</h2>");
                                sb.AppendLine("</div>");
                            }
                            var tableAliasName = item.__config__.tableName.ToPascalCase();
                            sb.AppendLine($"\t<el-table :data=\"dataForm.{tableAliasName.LowerFirstChar()}\" size='mini'>");
                            sb.AppendLine("\t<el-table-column type=\"index\" width=\"50\" label=\"序号\" align=\"center\" />");
                            List<string> FormTableColumn = new List<string>();
                            foreach (var children in config.children)
                            {
                                var childrenConfig = children.__config__;
                                var chilModel = children.__vModel__.Replace("F_", "").Replace("f_", "").ToPascalCase();
                                var vModel = chilModel.LowerFirstChar();
                                FormTableColumn.Add(chilModel);

                                var style = children.style != null ? $":style='{children.style.ToJson()}'" : "";
                                var placeholder = item.placeholder != null ? $"placeholder=\"{item.placeholder}\" " : "";
                                var clearable = children.clearable ? "clearable " : "";
                                var @readonly = children.@readonly ? "readonly " : "";
                                var disabled = children.disabled ? "disabled " : "";
                                var show_word_limit = children.showwordlimit ? "show-word-limit " : "";
                                var type = children.type != null ? $"type=\"{children.type}\" " : "";
                                var format = children.format != null ? $"format=\"{children.format}\" " : "";
                                var valueFormat = children.valueformat != null ? $"value-format=\"{children.valueformat}\" " : "";
                                var autosize = children.autosize != null ? $":autosize='{children.autosize.ToJson()}' " : "";
                                var multiple = children.multiple ? $":multiple=\"{children.multiple}\" " : "";
                                var size = children.__config__.optionType != null ? (children.__config__.optionType == "default" ? "" : $"size=\"{children.size}\" ") : "";

                                sb.AppendLine($"<el-table-column prop=\"{vModel}\" label=\"{children.__config__.label}\">");
                                sb.AppendLine("<template slot-scope=\"scope\">");
                                switch (children.__config__.jnpfKey)
                                {
                                    case "select":
                                        {
                                            var props = children.__config__.props;
                                            sb.AppendLine($"\t\t\t\t<{childrenConfig.tag} v-model=\"scope.row.{vModel}\" {placeholder}{clearable}{@readonly}{disabled}{show_word_limit}{style}{type}{format}{valueFormat}{autosize}{multiple}>");
                                            sb.AppendLine($"<el-option v-for=\"(item, index) in {vModel + "Options"}\" :key=\"index\" :label=\"item.{props.label}\" :value=\"item.{props.value}\" :disabled=\"item.disabled\"></el-option>");
                                            sb.AppendLine($"</{childrenConfig.tag}>");
                                            switch (children.__config__.dataType)
                                            {
                                                case "static":
                                                    GeneratorFormDataOptionsList[vModel + "Options"] = children.__slot__.options;
                                                    break;
                                                default:
                                                    GeneratorFormDataOptionsList[vModel + "Options"] = null;
                                                    break;
                                            }
                                        }
                                        break;
                                    default:
                                        {
                                            sb.AppendLine($"\t\t\t\t<{childrenConfig.tag} v-model=\"scope.row.{vModel}\" placeholder=\"{item.placeholder}\" {clearable}{@readonly}{disabled}{show_word_limit}{style}{type}{format}{valueFormat}{autosize}{multiple}{size}></{childrenConfig.tag}>");
                                        }
                                        break;
                                }
                                sb.AppendLine("</template>");
                                sb.AppendLine("</el-table-column>");
                            }
                            GeneratorFormTableColumnList[tableAliasName + "EntityList"] = FormTableColumn;
                            sb.AppendLine("<el-table-column label=\"操作\" width=\"50\">");
                            sb.AppendLine("<template slot-scope=\"scope\">");
                            sb.AppendLine($"<el-button size=\"mini\" type=\"text\" class=\"JNPF-table-delBtn\" @click=\"handleDel{tableAliasName}EntityList(scope.$index)\">删除</el-button></template>");
                            sb.AppendLine("</el-table-column>");
                            sb.AppendLine("\t</el-table>");
                            sb.AppendLine($"<div class=\"table-actions\" @click=\"addHandle{tableAliasName}EntityList()\">");
                            sb.AppendLine("<el-button type=\"text\" icon=\"el-icon-plus\">新增</el-button>");
                            sb.AppendLine("</div>");
                            sb.AppendLine("\t</el-form-item>");
                            sb.AppendLine("\t</el-col>");
                        }
                        break;
                    //卡片
                    case "card":
                        {
                            sb.AppendLine($"<el-card class=\"mb-20\" shadow=\"{item.shadow}\">");
                            sb.AppendFormat("{0}", GenerateFormChildrenControls(config.children, gutter));
                            sb.AppendLine("</el-card>");
                        }
                        break;
                    case "divider":
                        {
                            sb.AppendLine($"\t\t<el-col :span=\"{config.span}\">");
                            sb.AppendLine("\t\t<el-form-item label-width=\"0\">");
                            sb.AppendLine($"\t\t<el-divider content-position=\"{item.contentposition}\">{item.__slot__.@default}</el-divider>");
                            sb.AppendLine("\t\t</el-form-item>");
                            sb.AppendLine("\t\t</el-col>");
                        }
                        break;
                    case "groupTitle":
                        {
                            sb.AppendLine($"\t\t<el-col :span=\"{config.span}\">");
                            sb.AppendLine("\t\t<el-form-item label-width=\"0\">");
                            sb.AppendLine($"\t\t<groupTitle content-position=\"{item.contentposition}\" :content=\"{item.content}\"></groupTitle>");
                            sb.AppendLine("\t\t</el-form-item>");
                            sb.AppendLine("\t\t</el-col>");
                        }
                        break;
                    case "JNPFText":
                        {
                            sb.AppendLine($"\t\t<el-col :span=\"{config.span}\">");
                            sb.AppendLine("\t\t<el-form-item label-width=\"0\">");
                            sb.AppendLine($"\t\t<JNPF-Text :value=\"{item.__config__.defaultValue}\" :textStyle=\"{item.textStyle}\" :style=\"{item.style.ToJson()}\" ></JNPF-Text>");
                            sb.AppendLine("\t\t</el-form-item>");
                            sb.AppendLine("\t\t</el-col>");
                        }
                        break;
                    //常规
                    default:
                        {
                            var vModel = string.Empty;
                            var model = string.Empty;

                            var style = item.style != null ? $":style='{item.style.ToJson()}' " : "";
                            var clearable = item.clearable ? "clearable " : "";
                            var @readonly = item.@readonly ? "readonly " : "";
                            var required = config.required ? "required " : "";
                            var placeholder = item.placeholder != null ? $"placeholder=\"{item.placeholder}\" " : "";
                            var disabled = item.disabled ? "disabled " : "";
                            var show_word_limit = item.showwordlimit ? "show-word-limit " : "";
                            var type = !string.IsNullOrEmpty(item.type) ? $"type=\"{item.type}\" " : "";
                            var format = item.format != null ? $"format=\"{item.format}\" " : "";
                            var valueFormat = item.valueformat != null ? $"value-format=\"{item.valueformat}\" " : "";
                            var autosize = item.autosize != null ? $":autosize='{item.autosize.ToJson()}' " : "";
                            var multiple = item.multiple ? $"multiple " : "";
                            var isRange = item.isrange ? "is-range " : "";
                            var props = item.__config__.props;
                            var optionType = item.__config__.optionType == "default" ? "" : "-button";
                            var size = item.__config__.optionType != null ? (item.__config__.optionType == "default" ? "" : $"size=\"{item.size}\" ") : "";
                            var prefixIcon = item.prefixicon != null ? $"prefix-icon=\"{item.prefixicon}\" " : "";
                            var suffixIcon = item.suffixicon != null ? $"suffix-icon=\"{item.suffixicon}\" " : "";
                            var maxlength = item.maxlength != null ? $"maxlength=\"{item.maxlength}\" " : "";
                            var step = item.step != 0 ? $":step=\"{item.step}\" " : "";
                            var stepStrictly = item.stepstrictly ? "step-strictly " : "";
                            var controlsPosition = item.controlsposition != null ? $"controls-position=\"{item.controlsposition}\" " : "";
                            var showChinese = item.showChinese ? "showChinese " : "";
                            var showPassword = item.showPassword ? "show-password " : "";
                            var filterable = item.filterable ? "filterable " : "";
                            var showAllLevels = item.showAllLevels ? "show-all-levels " : "";
                            var separator = item.separator != null ? $"separator=\"{item.separator}\" " : "";
                            var rangeSeparator = item.rangeseparator != null ? $"range-separator=\"{item.rangeseparator}\" " : "";
                            var startPlaceholder = item.startplaceholder != null ? $"start-placeholder=\"{item.startplaceholder}\" " : "";
                            var endPlaceholder = item.endplaceholder != null ? $"end-placeholder=\"{item.endplaceholder}\" " : "";
                            var pickerOptions = item.pickeroptions != null ? $":picker-options='{item.pickeroptions.ToJson()}' " : "";
                            var max = item.max != 0 ? $":max=\"{item.max}\" " : "";
                            var allowHalf = item.allowhalf ? "allow-half " : "";
                            var showText = item.showtext ? $"show-text " : "";
                            var showScore = item.showScore ? $"show-score " : "";
                            var showAlpha = item.showalpha ? $"show-alpha " : "";
                            var colorFormat = item.colorformat != null ? $"color-format=\"{item.colorformat}\" " : "";
                            var activeText = item.activetext != null ? $"active-text=\"{item.activetext}\" " : "";
                            var inactiveText = item.inactivetext != null ? $"inactive-text=\"{item.inactivetext}\" " : "";
                            var activeColor = item.activecolor != null ? $"active-color=\"{item.activecolor}\" " : "";
                            var inactiveColor = item.inactivecolor != null ? $"inactive-color=\"{item.inactivecolor}\" " : "";
                            var isSwitch = item.__config__.jnpfKey == "switch" ? $":active-value=\"{item.activevalue}\" :inactive-value=\"{item.inactivevalue}\" " : "";
                            var min = item.min != 0 ? $":min=\"{item.min}\" " : "";
                            var showStops = item.showstops ? $"show-stops " : "";
                            var range = item.range ? $"range " : "";
                            var accept = item.accept != null ? $"accept=\"{item.accept}\" " : "";
                            var showTip = item.showTip ? $"showTip " : "";
                            var fileSize = item.fileSize != 0 ? $":fileSize=\"{item.fileSize}\" " : "";
                            var sizeUnit = item.sizeUnit != null ? $"sizeUnit=\"{item.sizeUnit}\" " : "";
                            var limit = item.limit != 0 ? $":limit=\"{item.limit}\" " : "";
                            var contentposition = item.contentposition != null ? $"content-position=\"{item.contentposition}\" " : "";
                            var buttonText = item.buttonText != null ? $"buttonText=\"{item.buttonText}\" " : "";
                            var level = item.level != 0 ? $":level=\"{item.level}\" " : "";
                            var actionText = item.actionText != null ? $"actionText=\"{item.actionText}\" " : "";
                            var shadow = item.shadow != null ? $"shadow=\"{item.shadow}\" " : "";
                            var content = item.content != null ? $"content=\"{item.content}\" " : "";
                            var noShow = item.__config__.noShow ? "v-if=\"false\" " : "";

                            if (!string.IsNullOrEmpty(item.__vModel__))
                            {
                                model = item.__vModel__.Replace("F_", "").Replace("f_", "").ToPascalCase();
                                var Model = model.LowerFirstChar();
                                switch (item.__config__.jnpfKey)
                                {
                                    case "uploadImg":
                                        vModel = $"v-model=\"{Model}List\" ";
                                        break;
                                    //上传文件
                                    case "uploadFz":
                                        vModel = $"v-model=\"{Model}List\" ";
                                        break;
                                    default:
                                        vModel = $"v-model=\"dataForm.{Model}\" ";
                                        break;
                                }
                                GeneratorFormDataList.Add(new GeneratorFormColumn()
                                {
                                    vModel = model,
                                    Model = model.LowerFirstChar(),
                                    jnpfKey = item.__config__.jnpfKey,
                                    dataType = item.__config__.dataType,
                                    dictionaryType = config.dataType == "dictionary" ? item.__config__.dictionaryType : (config.dataType == "dynamic" ? item.__config__.propsUrl : null),
                                    props = item.__config__.props != null ? new Utils.PropsModel()
                                    {
                                        label = item.__config__.props.label,
                                        value = item.__config__.props.value
                                    } : null,
                                    format = item.format,
                                    dateType = item.type,
                                    multiple = item.multiple ? item.multiple : (item.__config__.jnpfKey == "checkbox" ? true : false),
                                    billRule = item.__config__.rule,
                                    required = item.__config__.required,
                                    regList = item.__config__.regList,
                                    placeholder = item.__config__.label,
                                    range = item.range,
                                    defaultValue = item.__config__.defaultValue
                                });
                                model = model.LowerFirstChar();
                            }
                            sb.AppendLine($"\t\t<el-col :span=\"{config.span}\" {noShow}>");
                            sb.AppendLine($"<el-form-item label=\"{item.__config__.label}\" prop=\"{model}\">");
                            sb.AppendLine($"\t\t\t\t<{config.tag} {vModel}{placeholder}{clearable}{@readonly}{required}{disabled}{show_word_limit}{isRange}{style}{type}{format}{valueFormat}{autosize}{multiple}{size}{prefixIcon}{suffixIcon}{maxlength}{step}{stepStrictly}{controlsPosition}{showChinese}{showPassword}{filterable}{showAllLevels}{rangeSeparator}{startPlaceholder}{endPlaceholder}{separator}{pickerOptions}{max}{min}{allowHalf}{showText}{showScore}{showAlpha}{colorFormat}{activeText}{inactiveText}{activeColor}{inactiveColor}{isSwitch}{showStops}{range}{accept}{showTip}{fileSize}{sizeUnit}{limit}{contentposition}{buttonText}{level}{actionText}{shadow}{content}>");
                            switch (item.__config__.jnpfKey)
                            {
                                case "select":
                                    {
                                        sb.AppendLine($"<el-option v-for=\"(item, index) in {model + "Options"}\" :key=\"index\" :label=\"item.{props.label}\" :value=\"item.{props.value}\" ></el-option>");
                                        switch (item.__config__.dataType)
                                        {
                                            case "static":
                                                GeneratorFormDataOptionsList[model + "Options"] = item.__slot__.options;
                                                break;
                                            default:
                                                GeneratorFormDataOptionsList[model + "Options"] = null;
                                                break;
                                        }
                                    }
                                    break;
                                case "radio":
                                    {
                                        sb.AppendLine($"<el-radio{optionType} v-for=\"(item, index) in {model + "Options"}\" :key=\"index\" :label=\"item.{props.value}\"  >{{item.{props.label}}}</el-radio{optionType}>");
                                        switch (item.__config__.dataType)
                                        {
                                            case "static":
                                                GeneratorFormDataOptionsList[model + "Options"] = item.__slot__.options;
                                                break;
                                            default:
                                                GeneratorFormDataOptionsList[model + "Options"] = null;
                                                break;
                                        }
                                    }
                                    break;
                                case "checkbox":
                                    {
                                        sb.AppendLine($"<el-checkbox{optionType} v-for=\"(item, index) in {model + "Options"}\" :key=\"index\" :label=\"item.{props.value}\" >{{item.{props.label}}}</el-checkbox{optionType}>");
                                        switch (item.__config__.dataType)
                                        {
                                            case "static":
                                                GeneratorFormDataOptionsList[model + "Options"] = item.__slot__.options;
                                                break;
                                            default:
                                                GeneratorFormDataOptionsList[model + "Options"] = null;
                                                break;
                                        }
                                    }
                                    break;
                                case "comInput":
                                    {
                                        if (item.__slot__.prepend != null)
                                        {
                                            sb.AppendLine($"<template slot=\"prepend\">{item.__slot__.prepend}</template>");
                                        }
                                        if (item.__slot__.append != null)
                                        {
                                            sb.AppendLine($"<template slot=\"append\">{item.__slot__.append}</template>");
                                        }
                                    }
                                    break;
                                default:
                                    break;
                            }
                            sb.AppendLine($"</{config.tag}>");
                            sb.AppendLine("\t\t\t</el-form-item>");
                            sb.AppendLine("\t\t</el-col>");
                        }
                        break;
                }
            }
            return sb.ToString();
        }

        /// <summary>
        /// 生成表单数据参数
        /// </summary>
        /// <returns></returns>
        public string GenerateFormDataParameter(List<DbTableRelationModel> tableRelation)
        {
            StringBuilder sb = new StringBuilder();
            foreach (var item in GeneratorFormDataList)
            {
                var model = item.vModel.LowerFirstChar();
                //判断控件类型修改值为数组
                switch (item.jnpfKey)
                {
                    //复选框
                    case "checkbox":
                        sb.AppendLine($"\t\t\t\t\t{model}:{(item.defaultValue == null || item.defaultValue.ToString() == "" ? "''" : item.defaultValue.ToJson())},");
                        break;
                    //多选下拉框
                    case "select":
                        if (item.multiple)
                        {
                            sb.AppendLine($"\t\t\t\t\t{model}:{(item.defaultValue == null || item.defaultValue.ToString() == "" ? "''" : item.defaultValue.ToJson())},");
                        }
                        else
                        {
                            sb.AppendLine($"\t\t\t\t\t{model}:{(item.defaultValue == null || item.defaultValue.ToString() == "" ? "undefined" : item.defaultValue.ToJson())},");
                        }
                        break;
                    //时间范围
                    case "timeRange":
                        sb.AppendLine($"\t\t\t\t\t{model}:{(item.defaultValue == null || item.defaultValue.ToString() == "" ? "''" : item.defaultValue.ToJson())},");
                        break;
                    //日期范围
                    case "dateRange":
                        sb.AppendLine($"\t\t\t\t\t{model}:{(item.defaultValue == null || item.defaultValue.ToString() == "" ? "''" : item.defaultValue.ToJson())},");
                        break;
                    //级联选择
                    case "cascader":
                        sb.AppendLine($"\t\t\t\t\t{model}:{(item.defaultValue == null || item.defaultValue.ToString() == "" ? "''" : item.defaultValue.ToJson())},");
                        break;
                    //上传图片
                    case "uploadImg":
                        sb.AppendLine($"\t\t\t\t\t{model}:{(item.defaultValue == null || item.defaultValue.ToString() == "" ? "''" : item.defaultValue.ToJson())},");
                        break;
                    //上传文件
                    case "uploadFz":
                        sb.AppendLine($"\t\t\t\t\t{model}:{(item.defaultValue == null || item.defaultValue.ToString() == "" ? "''" : item.defaultValue.ToJson())},");
                        break;
                    //省市区
                    case "address":
                        sb.AppendLine($"\t\t\t\t\t{model}:{(item.defaultValue == null || item.defaultValue.ToString() == "" ? "''" : item.defaultValue.ToJson())},");
                        break;
                    case "createUser":
                        break;
                    case "createTime":
                        break;
                    case "modifyUser":
                        break;
                    case "modifyTime":
                        break;
                    case "currOrganize":
                        break;
                    case "currDept":
                        break;
                    case "currPosition":
                        break;
                    default:
                        sb.AppendLine($"\t\t\t\t\t{model}:{(item.defaultValue == null || item.defaultValue.ToString() == "" ? "undefined" : item.defaultValue.ToJson())},");
                        break;
                }
            }
            var tableList = tableRelation.FindAll(t => t.relationTable != "");
            foreach (var item in tableList)
            {
                var alias = item.table.ToPascalCase();
                sb.Append($"\t\t\t\t\t{alias.LowerFirstChar()} : [],");
            }
            return sb.ToString();
        }

        /// <summary>
        /// 生成表单数据参数
        /// </summary>
        /// <returns></returns>
        public string GenerateFormFileDataParameter()
        {
            StringBuilder sb = new StringBuilder();
            foreach (var item in GeneratorFormDataList)
            {
                var model = item.Model;
                //判断控件类型修改值为数组
                switch (item.jnpfKey)
                {
                    //复选框
                    case "checkbox":
                        sb.AppendLine($"\t\t\t\t\t{model}:[],");
                        break;
                    //下拉框多选
                    case "select":
                        if (item.multiple)
                        {
                            sb.AppendLine($"\t\t\t\t\t{model}:[],");
                        }
                        break;
                    //时间范围
                    case "timeRange":
                        sb.AppendLine($"\t\t\t\t\t{model}:[],");
                        break;
                    //日期范围
                    case "dateRange":
                        sb.AppendLine($"\t\t\t\t\t{model}:[],");
                        break;
                    //省市区
                    case "address":
                        sb.AppendLine($"\t\t\t\t\t{model}:[],");
                        break;
                    //上传图片
                    case "uploadImg":
                        sb.AppendLine($"\t\t\t\t\t{model}List:[],");
                        break;
                    //上传文件
                    case "uploadFz":
                        sb.AppendLine($"\t\t\t\t\t{model}List:[],");
                        break;
                }
            }
            return sb.ToString();
        }

        /// <summary>
        /// 生成表单选项数据
        /// </summary>
        /// <returns></returns>
        public string GenerateFormDataOptions()
        {
            StringBuilder sb = new StringBuilder();
            foreach (var item in GeneratorFormDataOptionsList)
            {
                sb.Append($"\t\t\t\t{item.Key}:");
                sb.Append("[");
                if (item.Value != null)
                {
                    var list = item.Value.ToObject<List<Dictionary<string, object>>>();
                    foreach (var valueItem in list)
                    {
                        sb.Append("{");
                        foreach (var items in valueItem)
                        {
                            sb.Append($"\"{items.Key}\":{items.Value.ToJson()},");
                        }
                        sb = new StringBuilder(sb.ToString().TrimEnd(','));
                        sb.Append("},");
                    }
                    sb = new StringBuilder(sb.ToString().TrimEnd(','));
                }
                sb.Append("],");
                sb.AppendLine();
            }
            return sb.ToString();
        }

        /// <summary>
        /// 生成表单左侧树参数
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public string GenerateFormTreeParameter(ColumnDataModel model)
        {
            StringBuilder sb = new StringBuilder();
            if (model.type == 2)
            {
                sb.AppendLine("\t\t\t\ttreeData: [],");
                sb.AppendLine("\t\t\t\ttreeActiveId: '',");
            }
            return sb.ToString();
        }

        /// <summary>
        /// 生成表单创建加载事件
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public string GenerateFormCreated(ColumnDataModel model)
        {
            StringBuilder sb = new StringBuilder();
            if (model.type == 2)
            {
                sb.AppendLine("\t\t\tthis.getTreeView();");
            }
            else
            {
                sb.AppendLine("\t\t\tthis.initData();");
            }
            return sb.ToString();
        }

        /// <summary>
        /// 生成表单树加载事件
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public string GenerateFormTreeMethods(ColumnDataModel model)
        {
            StringBuilder sb = new StringBuilder();
            if (model.type == 2)
            {
                sb.AppendLine("\t\t\tgetTreeView() {");
                sb.AppendLine($"\t\t\t\tgetDictionaryDataSelector('{model.treeDictionary}').then(res => {{");
                sb.AppendLine("\t\t\t\t\tthis.treeData = res.data.list");
                sb.AppendLine("\t\t\t\t\tthis.$nextTick(() => {");
                sb.AppendLine("\t\t\t\t\t\tthis.treeActiveId = this.treeData[0].id");
                sb.AppendLine("\t\t\t\t\t\tthis.$refs.treeBox.setCurrentKey(this.treeActiveId);");
                sb.AppendLine("\t\t\t\t\t\tthis.initData();");
                sb.AppendLine("\t\t\t\t\t});");
                sb.AppendLine("\t\t\t\t});");
                sb.AppendLine("\t\t\t},");
                sb.AppendLine("\t\t\thandleNodeClick(data) {");
                sb.AppendLine("\t\t\t\tthis.treeActiveId = data.id");
                sb.AppendLine("\t\t\t\tfor (let key in this.query) {");
                sb.AppendLine("\t\t\t\t\tthis.query[key] = undefined");
                sb.AppendLine("\t\t\t\t}");
                var relation = model.treeDbTableFieldRelation.Replace("F_", "").Replace("f_", "").ToPascalCase().LowerFirstChar();
                var treeQuery = GeneratorFormDataList.Find(p => p.Model == relation);
                if (treeQuery != null)
                {
                    relation = treeQuery.Model;
                }
                sb.AppendLine($"\t\t\t\tthis.query.{relation} = data.id");
                sb.AppendLine("\t\t\t\tthis.listQuery = {");
                sb.AppendLine("\t\t\t\t\tcurrentPage: 1,");
                sb.AppendLine("\t\t\t\t\tpageSize: 20,");
                sb.AppendLine("\t\t\t\t\tsort: \"desc\",");
                sb.AppendLine("\t\t\t\t\tsidx: \"\",");
                sb.AppendLine("\t\t\t\t}");
                sb.AppendLine("\t\t\t\tthis.initData()");
                sb.AppendLine("\t\t\t},");
            }
            return sb.ToString();
        }

        /// <summary>
        /// 获取静态数据创建
        /// </summary>
        /// <returns></returns>
        public string GenerateDictionaryDataCreated()
        {
            StringBuilder sb = new StringBuilder();
            var list = GeneratorFormDataList.FindAll(d => d.dataType == "dictionary" || d.dataType == "dynamic");
            foreach (var item in list)
            {
                sb.AppendLine($"\t\tthis.get{item.Model}Options();");
            }
            return sb.ToString();
        }

        /// <summary>
        /// 生成表单远端数据与数据字典方法
        /// </summary>
        /// <returns></returns>
        public string GenerateDictionaryDataMethods()
        {
            StringBuilder sb = new StringBuilder();
            var list = GeneratorFormDataList.FindAll(d => d.dataType == "dictionary" || d.dataType == "dynamic");
            foreach (var item in list)
            {
                sb.AppendLine($"\t\tget{item.Model}Options()");
                sb.AppendLine("\t\t{");
                switch (item.dataType)
                {
                    case "dictionary":
                        sb.AppendLine($"\t\t\tgetDictionaryDataSelector('{item.dictionaryType}').then(res => {{");
                        sb.AppendLine($"\t\t\t\tthis.{item.Model}Options = res.data.list");
                        break;
                    case "dynamic":
                        sb.AppendLine($"\t\t\tpreviewDataInterface('{item.dictionaryType}').then(res => {{");
                        sb.AppendLine($"\t\t\t\tthis.{item.Model}Options = res.data");
                        break;
                    default:
                        break;
                }
                sb.AppendLine("\t\t\t})");
                sb.AppendLine("\t\t},");
            }
            return sb.ToString();
        }

        /// <summary>
        /// 生成表单数据加载方法
        /// </summary>
        /// <param name="tableRelation"></param>
        /// <returns></returns>
        public string GenerateDataInitMethods(List<DbTableRelationModel> tableRelation)
        {
            StringBuilder sb = new StringBuilder();
            var tableList = tableRelation.FindAll(t => t.relationTable != "");
            foreach (var item in tableList)
            {
                //剔除第一个_前全部字母
                var alias = item.table.ToPascalCase();
                sb.AppendLine($"\t\t\t\tthis.dataForm.{alias.LowerFirstChar()} =[];");
            }
            return sb.ToString();
        }

        /// <summary>
        /// 生成表单数据列表加载方法
        /// </summary>
        /// <returns></returns>
        public string GenerateDataListInitMethods()
        {
            StringBuilder sb = new StringBuilder();
            foreach (var item in GeneratorFormDataList)
            {
                switch (item.jnpfKey)
                {
                    //复选框
                    case "checkbox":
                        sb.AppendLine($"\t\t\t\tthis.{item.Model} = this.dataForm.{item.Model} ? this.dataForm.{item.Model}.split(','):[];");
                        break;
                    //下拉框多选
                    case "select":
                        if (item.multiple)
                        {
                            sb.AppendLine($"\t\t\t\tthis.{item.Model} = this.dataForm.{item.Model} ? this.dataForm.{item.Model}.split(','):[];");
                        }
                        break;
                    //时间范围
                    case "timeRange":
                        sb.AppendLine($"\t\t\t\tthis.{item.Model} = this.dataForm.{item.Model} ? this.dataForm.{item.Model}.split(','):[];");
                        break;
                    //日期范围
                    case "dateRange":
                        sb.AppendLine($"\t\t\t\tthis.{item.Model} = this.dataForm.{item.Model} ? this.dataForm.{item.Model}.split(','):[];");
                        break;
                    //省市区
                    case "address":
                        sb.AppendLine($"\t\t\t\tthis.{item.Model} = this.dataForm.{item.Model} ? this.dataForm.{item.Model}.split(','):[];");
                        break;
                    //图片上传
                    case "uploadImg":
                        sb.AppendLine($"\t\t\t\tthis.{item.Model}List = this.dataForm.{item.Model} ? JSON.parse(this.dataForm.{item.Model}) : [];");
                        break;
                    //文件上传
                    case "uploadFz":
                        sb.AppendLine($"\t\t\t\tthis.{item.Model}List = this.dataForm.{item.Model} ? JSON.parse(this.dataForm.{item.Model}) : [];");
                        break;
                        //级联

                }
            }
            return sb.ToString();
        }

        /// <summary>
        /// 生成表单数据列表表单提交事宜
        /// </summary>
        /// <returns></returns>
        public string GenerateDataListFormSubmit()
        {
            StringBuilder sb = new StringBuilder();
            foreach (var item in GeneratorFormDataList)
            {
                switch (item.jnpfKey)
                {
                    case "checkbox":
                        sb.AppendLine($"\t\t\t\tthis.dataForm.{item.Model} = this.{item.Model}.join(',');");
                        break;
                    case "select":
                        if (item.multiple)
                        {
                            sb.AppendLine($"\t\t\t\tthis.dataForm.{item.Model} = this.{item.Model}.join(',');");
                        }
                        break;
                    case "timeRange":
                        sb.AppendLine($"\t\t\t\tthis.dataForm.{item.Model} = this.{item.Model}.join(',');");
                        break;
                    case "dateRange":
                        sb.AppendLine($"\t\t\t\tthis.dataForm.{item.Model} = this.{item.Model}.join(',');");
                        break;
                    case "address":
                        sb.AppendLine($"\t\t\t\tthis.dataForm.{item.Model} = this.{item.Model}.join(',');");
                        break;
                    case "uploadImg":
                        sb.AppendLine($"\t\t\t\tthis.$set(this.dataForm, '{item.Model}', JSON.stringify(this.{item.Model}List));");
                        break;
                    case "uploadFz":
                        sb.AppendLine($"\t\t\t\tthis.$set(this.dataForm, '{item.Model}', JSON.stringify(this.{item.Model}List));");
                        break;
                }
            }
            return sb.ToString();
        }

        /// <summary>
        /// 生成表单表格列
        /// </summary>
        /// <returns></returns>
        public string GeneratorFormTableColumn()
        {
            StringBuilder sb = new StringBuilder();
            foreach (var item in GeneratorFormTableColumnList)
            {
                var alias = item.Key.ToPascalCase();
                var table = alias.Replace("EntityList", "");
                sb.AppendLine($"\t\t\taddHandle{table}EntityList() {{");
                sb.AppendLine("\t\t\t\tlet item = {");
                var columcList = item.Value.ToObject<List<string>>();
                foreach (var items in columcList)
                {
                    sb.AppendLine($"\t\t\t\t\t{items}: undefined,");
                }
                sb.AppendLine("\t\t\t\t}");
                sb.AppendLine($"\t\t\t\tthis.dataForm.{table.LowerFirstChar()}.push(item)");
                sb.AppendLine("\t\t\t},");
                sb.AppendLine($"\t\t\thandleDel{table}EntityList(index) {{");
                sb.AppendLine($"\t\t\t\tthis.dataForm.{table.LowerFirstChar()}.splice(index, 1);");
                sb.AppendLine("\t\t\t},");
            }
            return sb.ToString();
        }

        /// <summary>
        /// 生成表单数组转字符串
        /// </summary>
        /// <returns></returns>
        public string GeneratorFormArrayTurnString()
        {
            StringBuilder sb = new StringBuilder();
            foreach (var item in GeneratorFormDataList)
            {
                //判断控件类型修改值为数组
                switch (item.jnpfKey)
                {
                    //复选框
                    case "checkbox":
                        sb.AppendLine($"\t\t\t\tif (!this.dataForm.{item.vModel}) this.dataForm.{item.vModel} = [];");
                        //sb.AppendLine($"\t\tthis.dataForm.{item.vModel}= res.data.{item.vModel}.split(',');");
                        break;
                    //多选下拉框
                    case "select":
                        if (item.multiple)
                        {
                            sb.AppendLine($"\t\t\t\tthis.dataForm.{item.vModel}= res.data.{item.vModel}.split(',');");
                        }
                        break;
                    //时间范围
                    case "timeRange":
                        sb.AppendLine($"\t\t\t\tthis.dataForm.{item.vModel}= res.data.{item.vModel}.split(',');");
                        break;
                    //日期范围
                    case "dateRange":
                        sb.AppendLine($"\t\t\t\tthis.dataForm.{item.vModel}= res.data.{item.vModel}.split(',');");
                        break;
                    //级联选择
                    case "cascader":
                        sb.AppendLine($"\t\t\t\tthis.dataForm.{item.vModel}= res.data.{item.vModel}.split(',');");
                        break;
                    //上传图片
                    case "uploadImg":
                        sb.AppendLine($"\t\t\t\tthis.dataForm.{item.vModel}= res.data.{item.vModel}.split(',');");
                        break;
                    //上传文件
                    case "uploadFz":
                        sb.AppendLine($"\t\t\t\tthis.dataForm.{item.vModel}= res.data.{item.vModel}.split(',');");
                        break;
                }
            }
            return sb.ToString();
        }

        /// <summary>
        /// 生成表单字符串转数组
        /// </summary>
        /// <returns></returns> 
        public string GeneratorFormStringTurnArray()
        {
            StringBuilder sb = new StringBuilder();
            foreach (var item in GeneratorFormDataList)
            {
                //判断控件类型修改值为数组
                switch (item.jnpfKey)
                {
                    //复选框
                    case "checkbox":
                        sb.AppendLine($"\t\tthis.dataForm.{item.vModel}= this.dataForm.{item.vModel}.join(',');");
                        break;
                    //多选下拉框
                    case "select":
                        if (item.multiple)
                        {
                            sb.AppendLine($"\t\tthis.dataForm.{item.vModel}= this.dataForm.{item.vModel}.join(',');");
                        }
                        break;
                    //时间范围
                    case "timeRange":
                        sb.AppendLine($"\t\tthis.dataForm.{item.vModel}= this.dataForm.{item.vModel}.join(',');");
                        break;
                    //日期范围
                    case "dateRange":
                        sb.AppendLine($"\t\tthis.dataForm.{item.vModel}= this.dataForm.{item.vModel}.join(',');");
                        break;
                    //级联选择
                    case "cascader":
                        sb.AppendLine($"\t\tthis.dataForm.{item.vModel}= this.dataForm.{item.vModel}.join(',');");
                        break;
                    //上传图片
                    case "uploadImg":
                        sb.AppendLine($"\t\tthis.dataForm.{item.vModel}= this.dataForm.{item.vModel}.join(',');");
                        break;
                    //上传文件
                    case "uploadFz":
                        sb.AppendLine($"\t\tthis.dataForm.{item.vModel}= this.dataForm.{item.vModel}.join(',');");
                        break;
                }
            }
            return sb.ToString();
        }

        /// <summary>
        /// 生成表单验证
        /// </summary>
        /// <returns></returns>
        public string GeneratorFormValidation()
        {
            StringBuilder sb = new StringBuilder();
            foreach (var item in GeneratorFormDataList)
            {
                if (item.required || (item.regList != null && item.regList.ToJson() != "[]"))
                {
                    sb.AppendLine($"\t\t\t\t\t\t{item.Model}:[");
                    if (item.required)
                    {
                        var trigger = item.trigger.ToJson().Contains("[") ? item.trigger : "'" + item.trigger + "'";
                        sb.AppendLine("\t\t\t\t\t\t{");
                        sb.AppendLine("\t\t\t\t\t\t\trequired:true,");
                        sb.AppendLine($"\t\t\t\t\t\t\tmessage:'请输入{item.placeholder}',");
                        sb.AppendLine($"\t\t\t\t\t\t\ttrigger:{trigger}");
                        sb.AppendLine("\t\t\t\t\t\t},");
                    }
                    if (item.regList != null && item.regList.ToJson() != "[]")
                    {
                        var regList = item.regList.ToObject<List<Dictionary<string, string>>>();
                        sb.AppendLine("\t\t\t\t\t\t{");
                        foreach (var items in regList)
                        {
                            foreach (var reg in items)
                            {
                                if (reg.Key.Contains("pattern"))
                                {
                                    sb.AppendLine($"\t\t\t\t\t\t\t{reg.Key}:{reg.Value},");
                                }
                                else
                                {
                                    sb.AppendLine($"\t\t\t\t\t\t\t{reg.Key}:'{reg.Value}',");
                                }
                            }
                            var trigger = item.trigger.ToJson().Contains("[") ? item.trigger : "'" + item.trigger + "'";
                            sb.AppendLine($"\t\t\t\t\t\t\ttrigger:{trigger}");
                        }
                        sb.AppendLine("\t\t\t\t\t\t},");
                    }
                    sb.AppendLine("\t\t\t\t\t\t],");
                }
            }
            return sb.ToString();
        }

        #endregion

        #region APP端

        /// <summary>
        /// 生成APP表单控件主体
        /// </summary>
        /// <param name="form"></param>
        /// <returns></returns>
        public string GenerateAppFormControlsMainBody(FormDataModel form)
        {
            //系统自动生成
            var autoGenerateList = new List<string>();
            autoGenerateList.Add("createUser");
            autoGenerateList.Add("createTime");
            autoGenerateList.Add("modifyUser");
            autoGenerateList.Add("modifyTime");
            autoGenerateList.Add("currOrganize");
            autoGenerateList.Add("currDept");
            autoGenerateList.Add("currPosition");
            ListQueryControlsType["autoGenerateList"] = autoGenerateList;

            var treeCascaderList = new List<string>();
            treeCascaderList.Add("cascader");
            treeCascaderList.Add("treeSelect");
            ListQueryControlsType["treeCascaderList"] = treeCascaderList;

            var dateTimeList = new List<string>();
            dateTimeList.Add("date");
            dateTimeList.Add("time");
            ListQueryControlsType["dateTimeList"] = dateTimeList;

            var staticSelectList = new List<string>();
            staticSelectList.Add("checkbox");
            staticSelectList.Add("radio");
            staticSelectList.Add("select");
            ListQueryControlsType["staticSelectList"] = staticSelectList;

            var seniorSelectList = new List<string>();
            seniorSelectList.Add("comSelect");
            seniorSelectList.Add("depSelect");
            seniorSelectList.Add("userSelect");
            seniorSelectList.Add("posSelect");
            ListQueryControlsType["seniorSelectList"] = seniorSelectList;

            var comInputList = new List<string>();
            comInputList.Add("comInput");
            comInputList.Add("numInput");
            ListQueryControlsType["comInputList"] = comInputList;

            GeneratorFormDataList = new List<GeneratorFormColumn>();
            GeneratorFormDataOptionsList = new Dictionary<string, object>();
            StringBuilder sb = new StringBuilder();
            foreach (var item in form.fields)
            {
                var config = item.__config__;
                //原始KEY
                var OriginalKey = string.Empty;
                var queryControls = ListQueryControlsType.Where(q => q.Value.Contains(config.jnpfKey)).FirstOrDefault();
                if (queryControls.Key != null)
                {
                    OriginalKey = config.jnpfKey;
                    config.jnpfKey = queryControls.Key;
                }

                var vModel = string.Empty;
                var model = string.Empty;
                model = item.__vModel__.Replace("F_", "").Replace("f_", "").ToPascalCase().LowerFirstChar();
                vModel = $"v-model=\"formData.{model}\" ";
                var noShow = config.noShow ? "<view v-if='false'>" : "<view>";
                var disabled = $":disabled =\"{item.disabled}\" ";
                var showLabel = $":showLabel='{config.showLabel}' ";
                var label = $"label='{config.label}' ";
                var content = "content='{item.content}' ";
                var required = $":required='{config.required}' ";
                var @readonly = $":readonly='{item.@readonly}' ";

                switch (config.jnpfKey)
                {
                    case "table":
                        {
                            var tableAliasName = item.__config__.tableName;
                            var childName = Regex.Replace(tableAliasName, @"^.*?_", "").ToPascalCase().LowerFirstChar();
                            List<string> FormTableColumn = new List<string>();
                            foreach (var children in config.children)
                            {
                                var childrenConfig = children.__config__;
                                var chilModel = children.__vModel__.Replace("F_", "").Replace("f_", "").ToPascalCase().LowerFirstChar();
                                FormTableColumn.Add(chilModel);

                                switch (children.__config__.jnpfKey)
                                {
                                    case "select":
                                        {
                                            switch (children.__config__.dataType)
                                            {
                                                case "static":
                                                    GeneratorFormDataOptionsList[chilModel + "Options"] = children.__slot__.options;
                                                    break;
                                                default:
                                                    GeneratorFormDataOptionsList[chilModel + "Options"] = null;
                                                    break;
                                            }
                                        }
                                        break;
                                }
                            }
                            GeneratorFormTableColumnList[childName + "EntityList"] = item;
                        }
                        break;
                    case "card":
                        break;
                    case "divider":
                        break;
                    case "groupTitle":
                        break;
                    case "JNPFText":
                        break;
                    default:
                        {
                            GeneratorFormDataList.Add(new GeneratorFormColumn()
                            {
                                vModel = model,
                                Model = item.__vModel__.Replace("F_", "").Replace("f_", ""),
                                jnpfKey = item.__config__.jnpfKey,
                                dataType = item.__config__.dataType,
                                dictionaryType = item.__config__.dictionaryType,
                                props = item.__config__.props != null ? new Utils.PropsModel()
                                {
                                    label = item.__config__.props.label,
                                    value = item.__config__.props.value
                                } : null,
                                format = item.format,
                                multiple = item.multiple ? item.multiple : (item.__config__.jnpfKey == "checkbox" ? true : false),
                                billRule = item.__config__.rule,
                                required = item.__config__.required,
                                regList = item.__config__.regList,
                                placeholder = item.__config__.label,
                                range = item.range
                            });
                        }
                        break;
                }

                var seniorList = string.Empty;
                if (config.jnpfKey == "seniorSelectList")
                {
                    switch (OriginalKey)
                    {
                        case "comSelect":
                            seniorList = " :comList='comList'";
                            break;
                        case "depSelect":
                            seniorList = " :depList='depList'";
                            break;
                        case "userSelect":
                            seniorList = " :userList='userList'";
                            break;
                        case "posSelect":
                            seniorList = " :postList='postList'";
                            break;
                    }
                }

                switch (config.jnpfKey)
                {
                    //表格
                    case "table":
                        {
                            var tableAliasName = item.__config__.tableName;
                            var childName = Regex.Replace(tableAliasName, @"^.*?_", "").ToLower();
                            sb.AppendLine($"\t\t\t\t\t<view v-for=\"(tableItem, tableIndex) in formData.{childName}\" :key=\"tableIndex\">");
                            sb.AppendLine("\t\t\t\t\t\t<view class=\"formgtitle formpadding\" style=\"width: 100%; background-color: #f0f2f6;\">");
                            sb.AppendLine("\t\t\t\t\t\t\t<view class=\"formgroup\">");
                            sb.AppendLine($"\t\t\t\t\t\t\t\t<view class=\"labletitle font-size24\"><label>{config.label}({{{{tableIndex+1}}}})</label></view>");
                            sb.AppendLine("\t\t\t\t\t\t\t\t<view class=\"controlvalue text-align-right font-size24\">");
                            sb.AppendLine($"\t\t\t\t\t\t\t\t\t<text class=\"color-4869EE\" @tap=\"removeDetailpro(tableIndex)\" v-if=\"formData.{childName}.length > 1\">删除</text>");
                            sb.AppendLine("\t\t\t\t\t\t\t\t</view>");
                            sb.AppendLine("\t\t\t\t\t\t\t</view>");
                            sb.AppendLine("\t\t\t\t\t\t</view>");
                            List<string> FormTableColumn = new List<string>();
                            foreach (var children in config.children)
                            {
                                var childrenConfig = children.__config__;
                                var chilModel = children.__vModel__.Replace("F_", "").Replace("F_", "").ToPascalCase().ToLower();
                                FormTableColumn.Add(chilModel);
                            }
                            sb.AppendLine("\t\t\t\t<view style=\"margin-bottom: 20rpx;\">");
                            sb.AppendLine($"\t\t\t\t\t<childTable :item='{childName}' :value=\"formData[item.__vModel__]\"/>");
                            sb.AppendLine("\t\t\t\t</view>");

                        }
                        break;
                    //卡片
                    case "card":
                        {
                            sb.AppendLine($"\t\t\t\t<view class=\"uni-flex-column\" style=\"margin-bottom: 20rpx; width: 100%;height: 100%;background-color: #FFFFFF; padding: 20rpx 20rpx;border: 1px dashed #E3E3E5;\">");
                            sb.AppendLine("\t\t\t\t\t<view class=\"labelSty border-bottom-E3E3E5\">");
                            sb.AppendLine($"\t\t\t\t\t\t<label for=\"\">{config.label}</label>");
                            sb.AppendLine("\t\t\t\t\t</view>");
                            sb.AppendFormat("{0}", GenerateAppFormCardControls(config.children));
                            sb.AppendLine("\t\t\t\t\t</view>");
                        }
                        break;
                    //分组标题
                    case "groupTitle":
                        {
                            GeneratorAppFormControls.Add("groupTitle");
                            sb.AppendLine($"\t\t\t\t\t{noShow}");
                            sb.AppendLine($"<groupTitle content='{item.content}' :showLabel='{config.showLabel}' label='{config.label}'></groupTitle>");
                            sb.AppendLine("\t\t\t\t\t</view>");
                        }
                        break;
                    //文本
                    case "JNPFText":
                        {
                            GeneratorAppFormControls.Add("JNPFText");
                            sb.AppendLine($"\t\t\t\t\t{noShow}");
                            sb.AppendLine($"\t\t\t\t\t\t<JNPFText color='{item.color}' fontStyle='normal' :showLabel='{config.showLabel}' label='{config.label}' defaultValue='{config.defaultValue}' textAlign='center' textDecoration='none'></JNPFText>");
                            sb.AppendLine("\t\t\t\t\t</view>");
                        }
                        break;
                    //评分
                    case "rate":
                        {
                            GeneratorAppFormControls.Add("JNPFRate");
                            sb.AppendLine($"\t\t\t\t\t{noShow}");
                            sb.AppendLine($"\t\t\t\t\t\t<JNPFRate {showLabel}{label}{disabled}{required}{vModel}{@readonly}:max='{item.max}' ></JNPFRate>");
                            sb.AppendLine("\t\t\t\t\t</view>");
                        }
                        break;
                    //开关
                    case "switch":
                        {
                            GeneratorAppFormControls.Add("JNPFSwitch");
                            sb.AppendLine($"\t\t\t\t\t{noShow}");
                            sb.AppendLine($"\t\t\t\t\t\t<JNPFSwitch {vModel}{required}{showLabel}{disabled}{label}></JNPFSwitch>");
                            sb.AppendLine("\t\t\t\t\t</view>");
                        }
                        break;
                    //上传图片
                    case "uploadImg":
                        {
                            GeneratorAppFormControls.Add("JNPFUpload");
                            sb.AppendLine($"\t\t\t\t\t{noShow}");
                            sb.AppendLine($"\t\t\t\t\t\t<JNPFUpload {required}{disabled}{showLabel}{label}{vModel} vModel='{config.jnpfKey}+\"Field\"+{config.formId}'></JNPFUpload>");
                            sb.AppendLine("\t\t\t\t\t</view>");
                        }
                        break;
                    //系统控件
                    case "autoGenerateList":
                        {
                            GeneratorAppFormControls.Add("autoGenerate");
                            sb.AppendLine($"\t\t\t\t\t{noShow}");
                            sb.AppendLine($"\t\t\t\t\t\t<autoGenerate {vModel}{label}jnpfKey=\"{OriginalKey}\" placeholder=\"系统自动生成\"></autoGenerate>");
                            sb.AppendLine("\t\t\t\t\t</view>");
                        }
                        break;
                    //省市区
                    case "address":
                        {
                            GeneratorAppFormControls.Add("addressSelect");
                            sb.AppendLine($"\t\t\t\t\t{noShow}");
                            sb.AppendLine($"\t\t\t\t\t\t<addressSelect {vModel}{showLabel}{required}{label}{disabled}jnpfKey='address' placeholder=\"请选择\" vModel='{config.jnpfKey}+\"Field\"+{config.formId}'></addressSelect>");
                            sb.AppendLine("\t\t\t\t\t</view>");
                        }
                        break;
                    //日期范围
                    case "dateRange":
                        {
                            GeneratorAppFormControls.Add("rangeTime");
                            sb.AppendLine($"\t\t\t\t\t{noShow}");
                            sb.AppendLine($"\t\t\t\t\t\t<rangeTime {vModel}{showLabel}{required}{label}placeholder=\"请选择\"></rangeTime>");
                            sb.AppendLine("\t\t\t\t\t</view>");
                        }
                        break;
                    //级联选择、树形选择
                    case "treeCascader":
                        {
                            GeneratorAppFormControls.Add("treeCascader");
                            sb.AppendLine($"\t\t\t\t\t{noShow}");
                            sb.AppendLine($"\t\t\t\t\t\t<treeCascader {vModel}{showLabel}{required}{label}{disabled}placeholder=\"请选择\" jnpfKey='{OriginalKey}' :options='{model}Options' vModel='{config.jnpfKey}+\"Field\"+{config.formId}'></treeCascader>");
                            sb.AppendLine("\t\t\t\t\t</view>");
                        }
                        break;
                    //日期，时间选择
                    case "dateTimeList":
                        {
                            GeneratorAppFormControls.Add("dateTime");
                            sb.AppendLine($"\t\t\t\t\t{noShow}");
                            sb.AppendLine($"\t\t\t\t\t\t<dateTime {vModel}{showLabel}{required}{label}{disabled}placeholder=\"请选择\" jnpfKey='{OriginalKey}' vModel='{config.jnpfKey}+\"Field\"+{config.formId}'></dateTime>");
                            sb.AppendLine("\t\t\t\t\t</view>");
                        }
                        break;
                    //多选，单选，下拉
                    case "staticSelectList":
                        {
                            GeneratorAppFormControls.Add("staticSelect");
                            sb.AppendLine($"\t\t\t\t\t{noShow}");
                            sb.AppendLine($"\t\t\t\t\t\t<staticSelect {vModel}{showLabel}{required}{label}{disabled}vModel='{config.jnpfKey}+\"Field\"+{config.formId}' dataType='{config.dataType}' :options='{model}Options' placeholder=\"请选择\"></staticSelect>");
                            sb.AppendLine("\t\t\t\t\t</view>");
                        }
                        break;
                    //公司
                    case "seniorSelectList":
                        {
                            GeneratorAppFormControls.Add(OriginalKey);
                            sb.AppendLine($"\t\t\t\t\t{noShow}");
                            sb.AppendLine($"\t\t\t\t\t\t<{OriginalKey} {vModel}{showLabel}{required}{label}{disabled}vModel='{config.jnpfKey}+\"Field\"+{config.formId}' jnpfKey='{OriginalKey}' placeholder=\"请选择\"{seniorList}></{OriginalKey}>");
                            sb.AppendLine("\t\t\t\t\t</view>");
                        }
                        break;
                    //单行,数字
                    case "comInputList":
                        {
                            GeneratorAppFormControls.Add("comInput");
                            sb.AppendLine($"\t\t\t\t\t{noShow}");
                            sb.AppendLine($"\t\t\t\t\t\t<comInput {vModel}{showLabel}{required}{label}{disabled}jnpfKey=\"input\" :maxlength=\"{item.maxlength}\" placeholder=\"请输入\"></comInput>");
                            sb.AppendLine("\t\t\t\t\t</view>");
                        }
                        break;
                    //多行
                    case "textarea":
                        {
                            GeneratorAppFormControls.Add("ymTextarea");
                            sb.AppendLine($"\t\t\t\t\t{noShow}");
                            sb.AppendLine($"\t\t\t\t\t\t<ymTextarea {vModel}{showLabel}{required}{label}{disabled}jnpfKey=\"textarea\" :maxlength=\"{item.maxlength}\" placeholder=\"请输入\"></ymTextarea>");
                            sb.AppendLine("\t\t\t\t\t</view>");
                        }
                        break;
                    //常规
                    default:
                        {
                            GeneratorAppFormControls.Add(config.jnpfKey);
                            sb.AppendLine($"\t\t\t\t\t{noShow}");
                            sb.AppendLine($"\t\t\t\t\t\t<{config.jnpfKey} {content}{label}{vModel}{showLabel}{required}{disabled}{@readonly}></{config.jnpfKey}>");
                            sb.AppendLine("\t\t\t\t\t</view>");
                        }
                        break;
                }
            }
            var confirmButtonText = string.IsNullOrEmpty(form.confirmButtonText) ? "取 消" : form.confirmButtonText;
            var cancelButtonText = string.IsNullOrEmpty(form.cancelButtonText) ? "保 存" : form.cancelButtonText;
            return sb.ToString();
        }

        /// <summary>
        /// 生成APP卡片控件
        /// </summary>
        /// <param name="childrenList"></param>
        /// <returns></returns>
        public string GenerateAppFormCardControls(List<FieldsModel> childrenList)
        {
            GeneratorAppFormControls = new List<string>();
            StringBuilder sb = new StringBuilder();
            //系统自动生成
            var autoGenerateList = new List<string>();
            autoGenerateList.Add("createUser");
            autoGenerateList.Add("createTime");
            autoGenerateList.Add("modifyUser");
            autoGenerateList.Add("modifyTime");
            autoGenerateList.Add("currOrganize");
            autoGenerateList.Add("currDept");
            autoGenerateList.Add("currPosition");
            ListQueryControlsType["autoGenerateList"] = autoGenerateList;

            var treeCascaderList = new List<string>();
            treeCascaderList.Add("cascader");
            treeCascaderList.Add("treeSelect");
            ListQueryControlsType["treeCascaderList"] = treeCascaderList;

            var dateTimeList = new List<string>();
            dateTimeList.Add("date");
            dateTimeList.Add("time");
            ListQueryControlsType["dateTimeList"] = dateTimeList;

            var staticSelectList = new List<string>();
            staticSelectList.Add("checkbox");
            staticSelectList.Add("radio");
            staticSelectList.Add("select");
            ListQueryControlsType["staticSelectList"] = staticSelectList;

            var seniorSelectList = new List<string>();
            seniorSelectList.Add("comSelect");
            seniorSelectList.Add("depSelect");
            seniorSelectList.Add("userSelect");
            seniorSelectList.Add("posSelect");
            ListQueryControlsType["seniorSelectList"] = seniorSelectList;

            var comInputList = new List<string>();
            comInputList.Add("comInput");
            comInputList.Add("numInput");
            ListQueryControlsType["comInputList"] = comInputList;

            GeneratorFormDataList = new List<GeneratorFormColumn>();
            GeneratorFormDataOptionsList = new Dictionary<string, object>();
            foreach (var item in childrenList)
            {
                var config = item.__config__;
                //原始KEY
                var OriginalKey = string.Empty;
                var queryControls = ListQueryControlsType.Where(q => q.Value.Contains(config.jnpfKey)).FirstOrDefault();
                if (queryControls.Key != null)
                {
                    OriginalKey = config.jnpfKey;
                    config.jnpfKey = queryControls.Key;
                }

                var vModel = string.Empty;
                var model = string.Empty;
                model = item.__vModel__.Replace("F_", "").Replace("f_", "").ToPascalCase().ToLower();
                vModel = $"v-model=\"formData.{model}\" ";
                var noShow = config.noShow ? "<view v-if='false'>" : "<view>";
                var disabled = $":disabled =\"{item.disabled}\" ";
                var showLabel = $":showLabel='{config.showLabel}' ";
                var label = $"label='{config.label}' ";
                var content = "content='{item.content}' ";
                var required = $":required='{config.required}' ";
                var @readonly = $":readonly='{item.@readonly}' ";

                switch (config.jnpfKey)
                {
                    case "card":
                        break;
                    case "divider":
                        break;
                    case "groupTitle":
                        break;
                    case "JNPFText":
                        break;
                    default:
                        {
                            GeneratorFormDataList.Add(new GeneratorFormColumn()
                            {
                                vModel = model,
                                Model = item.__vModel__.Replace("F_", "").Replace("f_", ""),
                                jnpfKey = item.__config__.jnpfKey,
                                dataType = item.__config__.dataType,
                                dictionaryType = item.__config__.dictionaryType,
                                props = item.__config__.props != null ? new Utils.PropsModel()
                                {
                                    label = item.__config__.props.label,
                                    value = item.__config__.props.value
                                } : null,
                                format = item.format,
                                multiple = item.multiple ? item.multiple : (item.__config__.jnpfKey == "checkbox" ? true : false),
                                billRule = item.__config__.rule,
                                required = item.__config__.required,
                                regList = item.__config__.regList,
                                placeholder = item.__config__.label,
                                range = item.range
                            });
                        }
                        break;
                }

                var seniorList = string.Empty;
                if (config.jnpfKey == "seniorSelectList")
                {
                    switch (OriginalKey)
                    {
                        case "comSelect":
                            seniorList = " :comList='comList'";
                            break;
                        case "depSelect":
                            seniorList = " :depList='depList'";
                            break;
                        case "userSelect":
                            seniorList = " :userList='userList'";
                            break;
                        case "posSelect":
                            seniorList = " :postList='postList'";
                            break;
                    }
                }

                switch (config.jnpfKey)
                {
                    //分组标题
                    case "groupTitle":
                        {
                            GeneratorAppFormControls.Add("groupTitle");
                            sb.AppendLine($"\t\t\t\t\t{noShow}");
                            sb.AppendLine($"<groupTitle content='{item.content}' :showLabel='{config.showLabel}' label='{config.label}'></groupTitle>");
                            sb.AppendLine("\t\t\t\t\t</view>");
                        }
                        break;
                    //文本
                    case "JNPFText":
                        {
                            GeneratorAppFormControls.Add("JNPFText");
                            sb.AppendLine($"\t\t\t\t\t{noShow}");
                            sb.AppendLine($"\t\t\t\t\t\t<JNPFText color='{item.color}' fontStyle='normal' :showLabel='{config.showLabel}' label='{config.label}' defaultValue='{config.defaultValue}' textAlign='center' textDecoration='none'></JNPFText>");
                            sb.AppendLine("\t\t\t\t\t</view>");
                        }
                        break;
                    //评分
                    case "rate":
                        {
                            GeneratorAppFormControls.Add("JNPFRate");
                            sb.AppendLine($"\t\t\t\t\t{noShow}");
                            sb.AppendLine($"\t\t\t\t\t\t<JNPFRate {showLabel}{label}{disabled}{required}{vModel}{@readonly}:max='{item.max}' ></JNPFRate>");
                            sb.AppendLine("\t\t\t\t\t</view>");
                        }
                        break;
                    //开关
                    case "switch":
                        {
                            GeneratorAppFormControls.Add("JNPFSwitch");
                            sb.AppendLine($"\t\t\t\t\t{noShow}");
                            sb.AppendLine($"\t\t\t\t\t\t<JNPFSwitch {vModel}{required}{showLabel}{disabled}{label}></JNPFSwitch>");
                            sb.AppendLine("\t\t\t\t\t</view>");
                        }
                        break;
                    //上传图片
                    case "uploadImg":
                        {
                            GeneratorAppFormControls.Add("JNPFUpload");
                            sb.AppendLine($"\t\t\t\t\t{noShow}");
                            sb.AppendLine($"\t\t\t\t\t\t<JNPFUpload {required}{disabled}{showLabel}{label}{vModel} vModel='{config.jnpfKey}+\"Field\"+{config.formId}'></JNPFUpload>");
                            sb.AppendLine("\t\t\t\t\t</view>");
                        }
                        break;
                    //系统控件
                    case "autoGenerateList":
                        {
                            GeneratorAppFormControls.Add("autoGenerate");
                            sb.AppendLine($"\t\t\t\t\t{noShow}");
                            sb.AppendLine($"\t\t\t\t\t\t<autoGenerate {vModel}{label}jnpfKey=\"{OriginalKey}\" placeholder=\"系统自动生成\"></autoGenerate>");
                            sb.AppendLine("\t\t\t\t\t</view>");
                        }
                        break;
                    //省市区
                    case "address":
                        {
                            GeneratorAppFormControls.Add("addressSelect");
                            sb.AppendLine($"\t\t\t\t\t{noShow}");
                            sb.AppendLine($"\t\t\t\t\t\t<addressSelect {vModel}{showLabel}{required}{label}{disabled}jnpfKey='address' placeholder=\"请选择\" vModel='{config.jnpfKey}+\"Field\"+{config.formId}'></addressSelect>");
                            sb.AppendLine("\t\t\t\t\t</view>");
                        }
                        break;
                    //日期范围
                    case "dateRange":
                        {
                            GeneratorAppFormControls.Add("rangeTime");
                            sb.AppendLine($"\t\t\t\t\t{noShow}");
                            sb.AppendLine($"\t\t\t\t\t\t<rangeTime {vModel}{showLabel}{required}{label}placeholder=\"请选择\"></rangeTime>");
                            sb.AppendLine("\t\t\t\t\t</view>");
                        }
                        break;
                    //级联选择、树形选择
                    case "treeCascader":
                        {
                            GeneratorAppFormControls.Add("treeCascader");
                            sb.AppendLine($"\t\t\t\t\t{noShow}");
                            sb.AppendLine($"\t\t\t\t\t\t<treeCascader {vModel}{showLabel}{required}{label}{disabled}placeholder=\"请选择\" jnpfKey='{OriginalKey}' :options='{model}Options' vModel='{config.jnpfKey}+\"Field\"+{config.formId}'></treeCascader>");
                            sb.AppendLine("\t\t\t\t\t</view>");
                        }
                        break;
                    //日期，时间选择
                    case "dateTimeList":
                        {
                            GeneratorAppFormControls.Add("dateTime");
                            sb.AppendLine($"\t\t\t\t\t{noShow}");
                            sb.AppendLine($"\t\t\t\t\t\t<dateTime {vModel}{showLabel}{required}{label}{disabled}placeholder=\"请选择\" jnpfKey='{OriginalKey}' vModel='{config.jnpfKey}+\"Field\"+{config.formId}'></dateTime>");
                            sb.AppendLine("\t\t\t\t\t</view>");
                        }
                        break;
                    //多选，单选，下拉
                    case "staticSelectList":
                        {
                            GeneratorAppFormControls.Add("staticSelect");
                            sb.AppendLine($"\t\t\t\t\t{noShow}");
                            sb.AppendLine($"\t\t\t\t\t\t<staticSelect {vModel}{showLabel}{required}{label}{disabled}vModel='{config.jnpfKey}+\"Field\"+{config.formId}' dataType='{config.dataType}' :options='{model}Options' placeholder=\"请选择\"></staticSelect>");
                            sb.AppendLine("\t\t\t\t\t</view>");
                        }
                        break;
                    //公司
                    case "seniorSelectList":
                        {
                            GeneratorAppFormControls.Add(OriginalKey);
                            sb.AppendLine($"\t\t\t\t\t{noShow}");
                            sb.AppendLine($"\t\t\t\t\t\t<{OriginalKey} {vModel}{showLabel}{required}{label}{disabled}vModel='{config.jnpfKey}+\"Field\"+{config.formId}' jnpfKey='{OriginalKey}' placeholder=\"请选择\"{seniorList}></{OriginalKey}>");
                            sb.AppendLine("\t\t\t\t\t</view>");
                        }
                        break;
                    //单行,数字
                    case "comInputList":
                        {
                            GeneratorAppFormControls.Add("comInput");
                            sb.AppendLine($"\t\t\t\t\t{noShow}");
                            sb.AppendLine($"\t\t\t\t\t\t<comInput {vModel}{showLabel}{required}{label}{disabled}jnpfKey=\"input\" :maxlength=\"{item.maxlength}\" placeholder=\"请输入\"></comInput>");
                            sb.AppendLine("\t\t\t\t\t</view>");
                        }
                        break;
                    //多行
                    case "textarea":
                        {
                            GeneratorAppFormControls.Add("ymTextarea");
                            sb.AppendLine($"\t\t\t\t\t{noShow}");
                            sb.AppendLine($"\t\t\t\t\t\t<ymTextarea {vModel}{showLabel}{required}{label}{disabled}jnpfKey=\"textarea\" :maxlength=\"{item.maxlength}\" placeholder=\"请输入\"></ymTextarea>");
                            sb.AppendLine("\t\t\t\t\t</view>");
                        }
                        break;
                    //常规
                    default:
                        {
                            GeneratorAppFormControls.Add(config.jnpfKey);
                            sb.AppendLine($"\t\t\t\t\t{noShow}");
                            sb.AppendLine($"\t\t\t\t\t\t<{config.jnpfKey} {content}{label}{vModel}{showLabel}{required}{disabled}{@readonly}></{config.jnpfKey}>");
                            sb.AppendLine("\t\t\t\t\t</view>");
                        }
                        break;
                }
            }
            return sb.ToString();
        }

        /// <summary>
        /// 生成APP表单控件参数目录
        /// </summary>
        /// <returns></returns>
        public string GenerateAppFormControlsDirectory()
        {
            StringBuilder sb = new StringBuilder();
            GeneratorAppFormControls.Distinct().ToList();
            foreach (var item in GeneratorAppFormControls)
            {
                switch (item)
                {
                    case "groupTitle":
                        sb.AppendLine("\timport groupTitle from '@/components/groupTitle/groupTitle.vue'");
                        break;
                    case "JNPFText":
                        sb.AppendLine("\timport JNPFText from '@/components/JNPFText/JNPFText.vue'");
                        break;
                    case "JNPFRate":
                        sb.AppendLine("\timport JNPFRate from '@/components/JNPFRate/JNPFRate.vue'");
                        break;
                    case "JNPFSwitch":
                        sb.AppendLine("\timport JNPFSwitch from '@/components/JNPFSwitch/JNPFSwitch.vue'");
                        break;
                    case "JNPFUpload":
                        sb.AppendLine("\timport JNPFUpload from '@/components/JNPFUpload/JNPFUpload.vue'");
                        break;
                    case "autoGenerate":
                        sb.AppendLine("import autoGenerate from '@/components/autoGenerate/autoGenerate.vue'");
                        break;
                    case "addressSelect":
                        sb.AppendLine("\timport addressSelect from '@/components/addressSelect/addressSelect.vue'");
                        break;
                    case "treeCascader":
                        sb.AppendLine("\timport treeCascader from '@/components/treeCascader/treeCascader.vue'");
                        break;
                    case "dateTime":
                        sb.AppendLine("\timport dateTime from '@/components/dateTime/dateTime.vue'");
                        break;
                    case "staticSelect":
                        sb.AppendLine("\timport staticSelect from '@/components/staticSelect/staticSelect.vue'");
                        break;
                    case "comInput":
                        sb.AppendLine("\timport comInput from '@/components/comInput/comInput.vue'");
                        break;
                    case "ymTextarea":
                        sb.AppendLine("\timport ymTextarea from '@/components/ym-Textarea/ym-Textarea.vue'");
                        break;
                    case "comSelect":
                        sb.AppendLine("\timport comSelect from '@/components/comSelect/comSelect.vue'");
                        break;
                    case "depSelect":
                        sb.AppendLine("\timport depSelect from '@/components/depSelect/depSelect.vue'");
                        break;
                    case "userSelect":
                        sb.AppendLine("\timport userSelect from '@/components/userSelect/userSelect.vue'");
                        break;
                    case "posSelect":
                        sb.AppendLine("\timport posSelect from '@/components/posSelect/posSelect.vue'");
                        break;
                    case "rangeTime":
                        sb.AppendLine("\timport rangeTime from '@/components/range-picker/rangeTime.vue'");
                        break;
                    case "JNPFSlider":
                        sb.AppendLine("\timport JNPFSlider from '@/components/JNPFSlider/JNPFSlider.vue'");
                        break;
                    default:
                        break;
                }
            }
            return sb.ToString();
        }

        /// <summary>
        /// 生成APP表单控件参数名称
        /// </summary>
        /// <returns></returns>
        public string GenerateAppFormControlsParameterName()
        {
            StringBuilder sb = new StringBuilder();
            GeneratorAppFormControls.Distinct().ToList();
            foreach (var item in GeneratorAppFormControls)
            {
                switch (item)
                {
                    case "groupTitle":
                        sb.AppendLine("\t\t\tgroupTitle");
                        break;
                    case "JNPFText":
                        sb.AppendLine("\t\t\tJNPFText");
                        break;
                    case "JNPFRate":
                        sb.AppendLine("\t\t\tJNPFRate");
                        break;
                    case "JNPFSwitch":
                        sb.AppendLine("\t\t\tJNPFSwitch");
                        break;
                    case "JNPFUpload":
                        sb.AppendLine("\t\t\tJNPFUpload");
                        break;
                    case "autoGenerate":
                        sb.AppendLine("\t\t\tautoGenerate");
                        break;
                    case "addressSelect":
                        sb.AppendLine("\t\t\taddressSelect");
                        break;
                    case "treeCascader":
                        sb.AppendLine("\t\t\ttreeCascader");
                        break;
                    case "dateTime":
                        sb.AppendLine("\t\t\tdateTime");
                        break;
                    case "staticSelect":
                        sb.AppendLine("\t\t\tstaticSelect");
                        break;
                    case "comInput":
                        sb.AppendLine("\t\t\tcomInput");
                        break;
                    case "ymTextarea":
                        sb.AppendLine("\t\t\tymTextarea");
                        break;
                    case "comSelect":
                        sb.AppendLine("\t\t\tcomSelect");
                        break;
                    case "depSelect":
                        sb.AppendLine("\t\t\tdepSelect");
                        break;
                    case "userSelect":
                        sb.AppendLine("\t\t\tuserSelect");
                        break;
                    case "posSelect":
                        sb.AppendLine("\t\t\tposSelect");
                        break;
                    case "rangeTime":
                        sb.AppendLine("\t\t\trangeTime");
                        break;
                    case "JNPFSlider":
                        sb.AppendLine("\t\t\tJNPFSlider");
                        break;
                    default:
                        break;
                }
            }
            return sb.ToString();
        }

        /// <summary>
        /// 生成表单数据参数
        /// </summary>
        /// <returns></returns>
        public string GenerateAppFormDataParameter()
        {
            StringBuilder sb = new StringBuilder();
            foreach (var item in GeneratorFormDataList)
            {
                //判断控件类型修改值为数组
                switch (item.jnpfKey)
                {
                    ////复选框
                    //case "checkbox":
                    //    sb.AppendLine($"\t\t\t\t\t{item.vModel}:[],");
                    //    break;
                    ////多选下拉框
                    //case "select":
                    //    if (item.multiple)
                    //    {
                    //        sb.AppendLine($"\t\t\t\t\t{item.vModel}:[],");
                    //    }
                    //    else
                    //    {
                    //        sb.AppendLine($"\t\t\t\t\t{item.vModel}:undefined,");
                    //    }
                    //    break;
                    ////时间范围
                    //case "timeRange":
                    //    sb.AppendLine($"\t\t\t\t\t{item.vModel}:[],");
                    //    break;
                    ////日期范围
                    //case "dateRange":
                    //    sb.AppendLine($"\t\t\t\t\t{item.vModel}:[],");
                    //    break;
                    ////级联选择
                    //case "cascader":
                    //    sb.AppendLine($"\t\t\t\t\t{item.vModel}:[],");
                    //    break;
                    ////上传图片
                    //case "uploadImg":
                    //    sb.AppendLine($"\t\t\t\t\t{item.vModel}:[],");
                    //    break;
                    ////上传文件
                    //case "uploadFz":
                    //    sb.AppendLine($"\t\t\t\t\t{item.vModel}:[],");
                    //    break;
                    default:
                        sb.AppendLine($"\t\t\t\t\t{item.vModel}:undefined,");
                        break;
                }
            }
            return sb.ToString();
        }

        public string GenerateAppChildreFormDataParameter(List<DbTableRelationModel> tableRelation)
        {
            StringBuilder sb = new StringBuilder();
            var tableList = tableRelation.FindAll(t => t.relationTable != "");
            foreach (var item in tableList)
            {
                //剔除第一个_前全部字母
                var tableAliasName = item.table;
                var alias = Regex.Replace(tableAliasName, @"^.*?_", "");
                sb.Append($"\t\t\t\t\t{alias.ToLower()} : [],");
            }
            return sb.ToString();
        }

        /// <summary>
        /// 生成表单选项数据
        /// </summary>
        /// <returns></returns>
        public string GenerateAppFormDataOptions()
        {
            StringBuilder sb = new StringBuilder();
            foreach (var item in GeneratorFormDataOptionsList)
            {
                sb.Append($"\t\t\t\t{item.Key}:");
                sb.Append("[");
                if (item.Value != null)
                {
                    var list = item.Value.ToObject<List<Dictionary<string, object>>>();
                    foreach (var valueItem in list)
                    {
                        sb.Append("{");
                        foreach (var items in valueItem)
                        {
                            sb.Append($"\"{items.Key}\":{items.Value.ToJson()},");
                        }
                        sb = new StringBuilder(sb.ToString().TrimEnd(','));
                        sb.Append("},");
                    }
                    sb = new StringBuilder(sb.ToString().TrimEnd(','));
                }
                sb.Append("],");
                sb.AppendLine();
            }
            return sb.ToString();
        }

        #endregion

        #region 流程表单

        /// <summary>
        /// 生成流程表单Form页面
        /// </summary>
        /// <param name="form"></param>
        /// <returns></returns>
        public string GenerateFlowFormControls(FormDataModel form)
        {
            GeneratorFormDataList = new List<GeneratorFormColumn>();
            GeneratorFormDataOptionsList = new Dictionary<string, object>();
            StringBuilder sb = new StringBuilder();
            sb.AppendLine($"\t\t\t<el-form ref=\"{form.formRef}\" :model=\"{form.formModel}\" :rules=\"{form.formRules}\" size=\"{form.size}\" label-width=\"{form.labelWidth}px\" label-position=\"{form.labelPosition}\" :disabled=\"setting.readonly\">");
            foreach (var item in form.fields)
            {
                var config = item.__config__;
                switch (config.jnpfKey)
                {
                    //栅格布局
                    case "row":
                        {
                            sb.AppendLine($"\t\t\t\t<el-col :span=\"{config.span}\">");
                            sb.AppendLine($"\t\t\t\t\t<el-row :gutter=\"{form.gutter}\">");
                            sb.AppendFormat("{0}", GenerateFlowFormChildreControls(config.children, form.gutter));
                            sb.AppendLine("\t\t\t\t\t</el-row>");
                            sb.AppendLine("\t\t\t\t</el-col>");
                        }
                        break;
                    //表格
                    case "table":
                        {
                            sb.AppendLine($"\t\t\t\t<el-col :span=\"{config.span}\">");
                            sb.AppendLine("\t\t\t\t\t<el-form-item label-width=\"0\">");
                            if (config.showTitle)
                            {
                                sb.AppendLine("\t\t\t\t\t\t<div class=\"JNPF-common-title\">");
                                sb.AppendLine($"\t\t\t\t\t\t\t<h2>{config.label}</h2>");
                                sb.AppendLine("\t\t\t\t\t\t</div>");
                            }
                            //剔除第一个_前全部字母
                            var childNameNum = item.__config__.tableName;
                            var alias = Regex.Replace(childNameNum, @"^.*?_", "").ToLower();
                            sb.AppendLine($"\t\t\t\t\t\t\t<el-table :data=\"dataForm.{alias}\" size='mini'>");
                            sb.AppendLine("\t\t\t\t\t\t\t\t<el-table-column type=\"index\" width=\"50\" label=\"序号\" align=\"center\" />");
                            List<string> FormTableColumn = new List<string>();
                            foreach (var children in config.children)
                            {
                                var childrenConfig = children.__config__;
                                var chilModel = children.__vModel__.Replace("F_", "").Replace("f_", "").ToPascalCase().ToLower();
                                FormTableColumn.Add(chilModel);

                                var style = children.style != null ? $":style='{children.style.ToJson()}'" : "";
                                var placeholder = item.placeholder != null ? $"placeholder=\"{item.placeholder}\" " : "";
                                var clearable = children.clearable ? "clearable " : "";
                                var @readonly = children.@readonly ? "readonly " : "";
                                var disabled = children.disabled ? "disabled " : "";
                                var show_word_limit = children.showwordlimit ? "show-word-limit " : "";
                                var type = children.type != null ? $"type=\"{children.type}\" " : "";
                                var format = children.format != null ? $"format=\"{children.format}\" " : "";
                                var valueFormat = children.valueformat != null ? $"value-format=\"{children.valueformat}\" " : "";
                                var autosize = children.autosize != null ? $":autosize='{children.autosize.ToJson()}' " : "";
                                var multiple = children.multiple ? $":multiple=\"{children.multiple}\" " : "";
                                var size = children.__config__.optionType != null ? (children.__config__.optionType == "default" ? "" : $"size=\"{children.size}\" ") : "";

                                sb.AppendLine($"\t\t\t\t\t\t\t\t<el-table-column prop=\"{chilModel}\" label=\"{children.__config__.label}\">");
                                sb.AppendLine("\t\t\t\t\t\t\t\t\t<template slot-scope=\"scope\">");
                                switch (children.__config__.jnpfKey)
                                {
                                    case "select":
                                        {
                                            var props = children.__config__.props;
                                            sb.AppendLine($"\t\t\t\t\t\t\t\t\t\t<{childrenConfig.tag} v-model=\"scope.row.{chilModel}\" {style}{placeholder}{clearable}{@readonly}{disabled} {multiple}>");
                                            sb.AppendLine($"\t\t\t\t\t\t\t\t\t\t\t<el-option v-for=\"(item, index) in {chilModel + "Options"}\" :key=\"index\" :label=\"item.{props.label}\" :value=\"item.{props.value}\" :disabled=\"item.disabled\"></el-option>");
                                            sb.AppendLine($"\t\t\t\t\t\t\t\t\t\t</{childrenConfig.tag}>");
                                            switch (children.__config__.dataType)
                                            {
                                                case "static":
                                                    GeneratorFormDataOptionsList[chilModel + "Options"] = children.__slot__.options;
                                                    break;
                                                default:
                                                    GeneratorFormDataOptionsList[chilModel + "Options"] = null;
                                                    break;
                                            }
                                        }
                                        break;
                                    default:
                                        {
                                            sb.AppendLine($"\t\t\t\t\t\t\t\t\t\t<{childrenConfig.tag} v-model=\"scope.row.{chilModel}\" {placeholder}{clearable}{size}{@readonly}{disabled}{show_word_limit}{style}{type}{format}{valueFormat}{autosize}{multiple}></{childrenConfig.tag}>");
                                        }
                                        break;
                                }
                                sb.AppendLine("\t\t\t\t\t\t\t\t\t</template>");
                                sb.AppendLine("\t\t\t\t\t\t\t\t</el-table-column>");
                            }
                            GeneratorFormTableColumnList[alias + "EntityList"] = FormTableColumn;
                            sb.AppendLine("\t\t\t\t\t\t\t\t<el-table-column label=\"操作\" width=\"50\">");
                            sb.AppendLine("\t\t\t\t\t\t\t\t\t<template slot-scope=\"scope\">");
                            sb.AppendLine($"\t\t\t\t\t\t\t\t\t\t<el-button size=\"mini\" type=\"text\" class=\"JNPF-table-delBtn\" @click=\"handleDel{alias}EntityList(scope.$index)\">删除</el-button>");
                            sb.AppendLine("\t\t\t\t\t\t\t\t\t</template>");
                            sb.AppendLine("\t\t\t\t\t\t\t\t</el-table-column>");
                            sb.AppendLine("\t\t\t\t\t\t\t</el-table>");
                            sb.AppendLine($"\t\t\t\t\t\t\t<div class=\"table-actions\" @click=\"addHandle{alias}EntityList()\">");
                            sb.AppendLine("\t\t\t\t\t\t\t\t<el-button type=\"text\" icon=\"el-icon-plus\">新增</el-button>");
                            sb.AppendLine("\t\t\t\t\t\t\t</div>");
                            sb.AppendLine("\t\t\t\t\t\t</el-form-item>");
                            sb.AppendLine("\t\t\t\t\t</el-col>");
                        }
                        break;
                    //卡片
                    case "card":
                        {
                            sb.AppendLine($"<el-card class=\"mb-20\" shadow=\"{item.shadow}\">");
                            sb.AppendFormat("{0}", GenerateFlowFormChildreControls(config.children, form.gutter));
                            sb.AppendLine("</el-card>");
                        }
                        break;
                    //分割线
                    case "divider":
                        {
                            sb.AppendLine($"\t\t<el-col :span=\"{config.span}\">");
                            sb.AppendLine("\t\t<el-form-item label-width=\"0\">");
                            sb.AppendLine($"\t\t<el-divider content-position=\"{item.contentposition}\">{item.__slot__.@default}</el-divider>");
                            sb.AppendLine("\t\t</el-form-item>");
                            sb.AppendLine("\t\t</el-col>");
                        }
                        break;
                    //分组标题
                    case "groupTitle":
                        {
                            sb.AppendLine($"\t\t<el-col :span=\"{config.span}\">");
                            sb.AppendLine("\t\t<el-form-item label-width=\"0\">");
                            sb.AppendLine($"\t\t<groupTitle content-position=\"{item.contentposition}\" :content=\"{item.content}\"></groupTitle>");
                            sb.AppendLine("\t\t</el-form-item>");
                            sb.AppendLine("\t\t</el-col>");
                        }
                        break;
                    //文本
                    case "JNPFText":
                        {
                            var textStyle = item.textStyle != null ? $":textStyle=\"{item.textStyle}\" " : "";
                            sb.AppendLine($"\t\t<el-col :span=\"{config.span}\">");
                            sb.AppendLine("\t\t<el-form-item label-width=\"0\">");
                            sb.AppendLine($"\t\t<JNPF-Text :value=\"{item.__config__.defaultValue}\" {textStyle}></JNPF-Text>");
                            sb.AppendLine("\t\t</el-form-item>");
                            sb.AppendLine("\t\t</el-col>");
                        }
                        break;
                    //常规
                    default:
                        {
                            var vModel = string.Empty;
                            var model = string.Empty;

                            var style = item.style != null ? $":style='{item.style.ToJson()}' " : "";
                            var clearable = item.clearable ? "clearable " : "";
                            var @readonly = item.@readonly ? "readonly " : "";
                            var required = config.required ? "required " : "";
                            var placeholder = item.placeholder != null ? $"placeholder=\"{item.placeholder}\" " : "";
                            var show_word_limit = item.showwordlimit ? "show-word-limit " : "";
                            var type = !string.IsNullOrEmpty(item.type) ? $"type=\"{item.type}\" " : "";
                            var format = item.format != null ? $"format=\"{item.format}\" " : "";
                            var valueFormat = item.valueformat != null ? $"value-format=\"{item.valueformat}\" " : "";
                            var autosize = item.autosize != null ? $":autosize='{item.autosize.ToJson()}' " : "";
                            var multiple = item.multiple ? $"multiple " : "";
                            var isRange = item.isrange ? "is-range " : "";
                            var props = item.__config__.props;
                            var optionType = item.__config__.optionType == "default" ? "" : "-button";
                            var size = item.__config__.optionType != null ? (item.__config__.optionType == "default" ? "" : $"size=\"{item.size}\" ") : "";
                            var prefixIcon = !string.IsNullOrEmpty(item.prefixicon) ? $"prefix-icon=\"{item.prefixicon}\" " : "";
                            var suffixIcon = !string.IsNullOrEmpty(item.suffixicon) ? $"suffix-icon=\"{item.suffixicon}\" " : "";
                            var maxlength = item.maxlength != null ? $"maxlength=\"{item.maxlength}\" " : "";
                            var step = item.step != 0 ? $":step=\"{item.step}\" " : "";
                            var stepStrictly = item.stepstrictly ? "step-strictly " : "";
                            var controlsPosition = item.controlsposition != null ? $"controls-position=\"{item.controlsposition}\" " : "";
                            var showChinese = item.showChinese ? "showChinese " : "";
                            var showPassword = item.showPassword ? "show-password " : "";
                            var filterable = item.filterable ? "filterable " : "";
                            var showAllLevels = item.showAllLevels ? "show-all-levels " : "";
                            var separator = item.separator != null ? $"separator=\"{item.separator}\" " : "";
                            var rangeSeparator = item.rangeseparator != null ? $"range-separator=\"{item.rangeseparator}\" " : "";
                            var startPlaceholder = item.startplaceholder != null ? $"start-placeholder=\"{item.startplaceholder}\" " : "";
                            var endPlaceholder = item.endplaceholder != null ? $"end-placeholder=\"{item.endplaceholder}\" " : "";
                            var pickerOptions = item.pickeroptions != null ? $":picker-options='{item.pickeroptions.ToJson()}' " : "";
                            var max = item.max != 0 ? $":max=\"{item.max}\" " : "";
                            var allowHalf = item.allowhalf ? "allow-half " : "";
                            var showText = item.showtext ? $"show-text " : "";
                            var showScore = item.showScore ? $"show-score " : "";
                            var showAlpha = item.showalpha ? $"show-alpha " : "";
                            var colorFormat = item.colorformat != null ? $"color-format=\"{item.colorformat}\" " : "";
                            var activeText = item.activetext != null ? $"active-text=\"{item.activetext}\" " : "";
                            var inactiveText = item.inactivetext != null ? $"inactive-text=\"{item.inactivetext}\" " : "";
                            var activeColor = item.activecolor != null ? $"active-color=\"{item.activecolor}\" " : "";
                            var inactiveColor = item.inactivecolor != null ? $"inactive-color=\"{item.inactivecolor}\" " : "";
                            var isSwitch = item.__config__.jnpfKey == "switch" ? $":active-value=\"{item.activevalue}\" :inactive-value=\"{item.inactivevalue}\" " : "";
                            var min = item.min != 0 ? $":min=\"{item.min}\" " : "";
                            var showStops = item.showstops ? $"show-stops " : "";
                            var range = item.range ? $"range " : "";
                            var accept = item.accept != null ? $"accept=\"{item.accept}\" " : "";
                            var showTip = item.showTip ? $"showTip " : "";
                            var fileSize = item.fileSize != 0 ? $":fileSize=\"{item.fileSize}\" " : "";
                            var sizeUnit = item.sizeUnit != null ? $"sizeUnit=\"{item.sizeUnit}\" " : "";
                            var limit = item.limit != 0 ? $":limit=\"{item.limit}\" " : "";
                            var contentposition = item.contentposition != null ? $"content-position=\"{item.contentposition}\" " : "";
                            var buttonText = item.buttonText != null ? $"buttonText=\"{item.buttonText}\" " : "";
                            var level = item.level != 0 ? $":level=\"{item.level}\" " : "";
                            var actionText = item.actionText != null ? $"actionText=\"{item.actionText}\" " : "";
                            var shadow = item.shadow != null ? $"shadow=\"{item.shadow}\" " : "";
                            var content = item.content != null ? $"content=\"{item.content}\" " : "";

                            if (!string.IsNullOrEmpty(item.__vModel__))
                            {
                                model = item.__vModel__.Replace("F_", "").Replace("f_", "").ToPascalCase().ToLower();
                                vModel = $"v-model=\"dataForm.{model}\" ";
                                GeneratorFormDataList.Add(new GeneratorFormColumn()
                                {
                                    vModel = model,
                                    Model = item.__vModel__.Replace("F_", "").Replace("f_", ""),
                                    jnpfKey = item.__config__.jnpfKey,
                                    dataType = item.__config__.dataType,
                                    dictionaryType = config.dataType == "dictionary" ? item.__config__.dictionaryType : (config.dataType == "dynamic" ? item.__config__.propsUrl : null),
                                    props = item.__config__.props != null ? new Utils.PropsModel()
                                    {
                                        label = item.__config__.props.label,
                                        value = item.__config__.props.value
                                    } : null,
                                    format = item.format,
                                    dateType = item.type,
                                    multiple = item.multiple ? item.multiple : (item.__config__.jnpfKey == "checkbox" ? true : false),
                                    billRule = item.__config__.rule,
                                    required = item.__config__.required,
                                    regList = item.__config__.regList,
                                    placeholder = item.__config__.label,
                                    range = item.range,
                                    defaultValue = item.__config__.defaultValue
                                });
                            }
                            sb.AppendLine($"\t\t\t\t<el-col :span=\"{config.span}\" v-if=\"JudgeShow('{model}')\">");
                            sb.AppendLine($"\t\t\t\t\t<el-form-item label=\"{item.__config__.label}\" prop=\"{model}\" {required}>");
                            sb.AppendLine($"\t\t\t\t\t\t<{config.tag} {vModel} :disabled =\"JudgeWrite('{model}')\"  {placeholder}{clearable}{@readonly}{show_word_limit}{isRange}{style}{type}{format}{valueFormat}{autosize}{multiple}{size}{prefixIcon}{suffixIcon}{maxlength}{step}{stepStrictly}{controlsPosition}{showChinese}{showPassword}{filterable}{showAllLevels}{rangeSeparator}{startPlaceholder}{endPlaceholder}{separator}{pickerOptions}{max}{min}{allowHalf}{showText}{showScore}{showAlpha}{colorFormat}{activeText}{inactiveText}{activeColor}{inactiveColor}{isSwitch}{showStops}{range}{accept}{showTip}{fileSize}{sizeUnit}{limit}{contentposition}{buttonText}{level}{actionText}{shadow}{content}>");
                            switch (item.__config__.jnpfKey)
                            {
                                case "select":
                                    {
                                        sb.AppendLine($"\t\t\t\t\t\t\t<el-option v-for=\"(item, index) in {model + "Options"}\" :key=\"index\" :label=\"item.{props.label}\" :value=\"item.{props.value}\" ></el-option>");
                                        switch (item.__config__.dataType)
                                        {
                                            case "static":
                                                GeneratorFormDataOptionsList[model + "Options"] = item.__slot__.options;
                                                break;
                                            default:
                                                GeneratorFormDataOptionsList[model + "Options"] = null;
                                                break;
                                        }
                                    }
                                    break;
                                case "radio":
                                    {
                                        sb.AppendLine($"\t\t\t\t\t\t\t<el-radio{optionType} v-for=\"(item, index) in {model + "Options"}\" :key=\"index\" :label=\"item.{props.value}\"  >{{{{item.{props.label}}}}}</el-radio{optionType}>");
                                        switch (item.__config__.dataType)
                                        {
                                            case "static":
                                                GeneratorFormDataOptionsList[model + "Options"] = item.__slot__.options;
                                                break;
                                            default:
                                                GeneratorFormDataOptionsList[model + "Options"] = null;
                                                break;
                                        }
                                    }
                                    break;
                                case "checkbox":
                                    {
                                        sb.AppendLine($"\t\t\t\t\t\t\t<el-checkbox{optionType} v-for=\"(item, index) in {model + "Options"}\" :key=\"index\" :label=\"item.{props.value}\" >{{{{item.{props.label}}}}}</el-checkbox{optionType}>");
                                        switch (item.__config__.dataType)
                                        {
                                            case "static":
                                                GeneratorFormDataOptionsList[model + "Options"] = item.__slot__.options;
                                                break;
                                            default:
                                                GeneratorFormDataOptionsList[model + "Options"] = null;
                                                break;
                                        }
                                    }
                                    break;
                                case "comInput":
                                    {
                                        if (item.__slot__.prepend != null)
                                        {
                                            sb.AppendLine($"\t\t\t\t\t\t\t<template slot=\"prepend\">{item.__slot__.prepend}</template>");
                                        }
                                        if (item.__slot__.append != null)
                                        {
                                            sb.AppendLine($"\t\t\t\t\t\t\t<template slot=\"append\">{item.__slot__.append}</template>");
                                        }
                                    }
                                    break;
                            }
                            sb.AppendLine($"\t\t\t\t\t\t</{config.tag}>");
                            sb.AppendLine("\t\t\t\t\t</el-form-item>");
                            sb.AppendLine("\t\t\t\t</el-col>");
                        }
                        break;
                }
            }
            sb.AppendLine("\t\t\t</el-form>");
            return sb.ToString();
        }

        public string GenerateFlowFormChildreControls(List<FieldsModel> childrenList, int gutter)
        {
            StringBuilder sb = new StringBuilder();
            foreach (var item in childrenList)
            {
                var config = item.__config__;
                switch (config.jnpfKey)
                {
                    //栅格布局
                    case "row":
                        {
                            sb.AppendLine($"<el-col :span=\"{config.span}\">");
                            sb.AppendLine($"<el-row :gutter=\"{gutter}\">");
                            sb.AppendFormat("{0}", GenerateFormChildrenControls(config.children, gutter));
                            sb.AppendLine("</el-row>");
                            sb.AppendLine("</el-col>");
                        }
                        break;
                    //表格
                    case "table":
                        {
                            sb.AppendLine($"\t<el-col :span=\"{config.span}\">");
                            sb.AppendLine("\t<el-form-item label-width=\"0\">");
                            if (config.showTitle)
                            {
                                sb.AppendLine("<div class=\"JNPF-common-title\">");
                                sb.AppendLine($"<h2>{config.label}</h2>");
                                sb.AppendLine("</div>");
                            }
                            //剔除第一个_前全部字母
                            var childNameNum = item.__config__.tableName;
                            var alias = Regex.Replace(childNameNum, @"^.*?_", "").ToLower();
                            sb.AppendLine($"\t<el-table :data=\"dataForm.{alias}\" size='mini'>");
                            sb.AppendLine("\t<el-table-column type=\"index\" width=\"50\" label=\"序号\" align=\"center\" />");
                            List<string> FormTableColumn = new List<string>();
                            foreach (var children in config.children)
                            {
                                var childrenConfig = children.__config__;
                                var chilModel = children.__vModel__.Replace("F_", "").Replace("f_", "").ToPascalCase().ToLower();
                                FormTableColumn.Add(chilModel);

                                var style = children.style != null ? $":style='{children.style.ToJson()}'" : "";
                                var placeholder = item.placeholder != null ? $"placeholder=\"{item.placeholder}\" " : "";
                                var clearable = children.clearable ? "clearable " : "";
                                var @readonly = children.@readonly ? "readonly " : "";
                                var disabled = children.disabled ? "disabled " : "";
                                var show_word_limit = children.showwordlimit ? "show-word-limit " : "";
                                var type = children.type != null ? $"type=\"{children.type}\" " : "";
                                var format = children.format != null ? $"format=\"{children.format}\" " : "";
                                var valueFormat = children.valueformat != null ? $"value-format=\"{children.valueformat}\" " : "";
                                var autosize = children.autosize != null ? $":autosize='{children.autosize.ToJson()}' " : "";
                                var multiple = children.multiple ? $":multiple=\"{children.multiple}\" " : "";
                                var size = children.__config__.optionType != null ? (children.__config__.optionType == "default" ? "" : $"size=\"{children.size}\" ") : "";

                                sb.AppendLine($"<el-table-column prop=\"{chilModel}\" label=\"{children.__config__.label}\">");
                                sb.AppendLine("<template slot-scope=\"scope\">");
                                switch (children.__config__.jnpfKey)
                                {
                                    case "select":
                                        {
                                            var props = children.__config__.props;
                                            sb.AppendLine($"\t\t\t\t<{childrenConfig.tag} v-model=\"scope.row.{chilModel}\" {placeholder}{clearable}{@readonly}{disabled}{show_word_limit}{style}{type}{format}{valueFormat}{autosize}{multiple}>");
                                            sb.AppendLine($"<el-option v-for=\"(item, index) in {chilModel + "Options"}\" :key=\"index\" :label=\"item.{props.label}\" :value=\"item.{props.value}\" :disabled=\"item.disabled\"></el-option>");
                                            sb.AppendLine($"</{childrenConfig.tag}>");
                                            switch (children.__config__.dataType)
                                            {
                                                case "static":
                                                    GeneratorFormDataOptionsList[chilModel + "Options"] = children.__slot__.options;
                                                    break;
                                                default:
                                                    GeneratorFormDataOptionsList[chilModel + "Options"] = null;
                                                    break;
                                            }
                                        }
                                        break;
                                    default:
                                        {
                                            sb.AppendLine($"\t\t\t\t<{childrenConfig.tag} v-model=\"scope.row.{chilModel}\" placeholder=\"{item.placeholder}\" {clearable}{@readonly}{disabled}{show_word_limit}{style}{type}{format}{valueFormat}{autosize}{multiple}{size}></{childrenConfig.tag}>");
                                        }
                                        break;
                                }
                                sb.AppendLine("</template>");
                                sb.AppendLine("</el-table-column>");
                            }
                            GeneratorFormTableColumnList[item.__config__.tableName + "EntityList"] = FormTableColumn;
                            sb.AppendLine("<el-table-column label=\"操作\" width=\"50\">");
                            sb.AppendLine("<template slot-scope=\"scope\">");
                            sb.AppendLine($"<el-button size=\"mini\" type=\"text\" class=\"JNPF-table-delBtn\" @click=\"handleDel{alias}EntityList(scope.$index)\">删除</el-button></template>");
                            sb.AppendLine("</el-table-column>");
                            sb.AppendLine("\t</el-table>");
                            sb.AppendLine($"<div class=\"table-actions\" @click=\"addHandle{alias}EntityList()\">");
                            sb.AppendLine("<el-button type=\"text\" icon=\"el-icon-plus\">新增</el-button>");
                            sb.AppendLine("</div>");
                            sb.AppendLine("\t</el-form-item>");
                            sb.AppendLine("\t</el-col>");
                        }
                        break;
                    //卡片
                    case "card":
                        {
                            sb.AppendLine($"<el-card class=\"mb-20\" shadow=\"{item.shadow}\">");
                            sb.AppendFormat("{0}", GenerateFormChildrenControls(config.children, gutter));
                            sb.AppendLine("</el-card>");
                        }
                        break;
                    case "divider":
                        {
                            sb.AppendLine($"\t\t<el-col :span=\"{config.span}\">");
                            sb.AppendLine("\t\t<el-form-item label-width=\"0\">");
                            sb.AppendLine($"\t\t<el-divider content-position=\"{item.contentposition}\">{item.__slot__.@default}</el-divider>");
                            sb.AppendLine("\t\t</el-form-item>");
                            sb.AppendLine("\t\t</el-col>");
                        }
                        break;
                    case "groupTitle":
                        {
                            sb.AppendLine($"\t\t<el-col :span=\"{config.span}\">");
                            sb.AppendLine("\t\t<el-form-item label-width=\"0\">");
                            sb.AppendLine($"\t\t<groupTitle content-position=\"{item.contentposition}\" :content=\"{item.content}\"></groupTitle>");
                            sb.AppendLine("\t\t</el-form-item>");
                            sb.AppendLine("\t\t</el-col>");
                        }
                        break;
                    case "JNPFText":
                        {
                            sb.AppendLine($"\t\t<el-col :span=\"{config.span}\">");
                            sb.AppendLine("\t\t<el-form-item label-width=\"0\">");
                            sb.AppendLine($"\t\t<JNPF-Text :value=\"{item.__config__.defaultValue}\" :textStyle=\"{item.textStyle}\" :style=\"{item.style.ToJson()}\" ></JNPF-Text>");
                            sb.AppendLine("\t\t</el-form-item>");
                            sb.AppendLine("\t\t</el-col>");
                        }
                        break;
                    //常规
                    default:
                        {
                            var vModel = string.Empty;
                            var model = string.Empty;

                            var style = item.style != null ? $":style='{item.style.ToJson()}' " : "";
                            var clearable = item.clearable ? "clearable " : "";
                            var @readonly = item.@readonly ? "readonly " : "";
                            var required = config.required ? "required " : "";
                            var placeholder = item.placeholder != null ? $"placeholder=\"{item.placeholder}\" " : "";
                            var disabled = item.disabled ? "disabled " : "";
                            var show_word_limit = item.showwordlimit ? "show-word-limit " : "";
                            var type = !string.IsNullOrEmpty(item.type) ? $"type=\"{item.type}\" " : "";
                            var format = item.format != null ? $"format=\"{item.format}\" " : "";
                            var valueFormat = item.valueformat != null ? $"value-format=\"{item.valueformat}\" " : "";
                            var autosize = item.autosize != null ? $":autosize='{item.autosize.ToJson()}' " : "";
                            var multiple = item.multiple ? $"multiple " : "";
                            var isRange = item.isrange ? "is-range " : "";
                            var props = item.__config__.props;
                            var optionType = item.__config__.optionType == "default" ? "" : "-button";
                            var size = item.__config__.optionType != null ? (item.__config__.optionType == "default" ? "" : $"size=\"{item.size}\" ") : "";
                            var prefixIcon = item.prefixicon != null ? $"prefix-icon=\"{item.prefixicon}\" " : "";
                            var suffixIcon = item.suffixicon != null ? $"suffix-icon=\"{item.suffixicon}\" " : "";
                            var maxlength = item.maxlength != null ? $"maxlength=\"{item.maxlength}\" " : "";
                            var step = item.step != 0 ? $":step=\"{item.step}\" " : "";
                            var stepStrictly = item.stepstrictly ? "step-strictly " : "";
                            var controlsPosition = item.controlsposition != null ? $"controls-position=\"{item.controlsposition}\" " : "";
                            var showChinese = item.showChinese ? "showChinese " : "";
                            var showPassword = item.showPassword ? "show-password " : "";
                            var filterable = item.filterable ? "filterable " : "";
                            var showAllLevels = item.showAllLevels ? "show-all-levels " : "";
                            var separator = item.separator != null ? $"separator=\"{item.separator}\" " : "";
                            var rangeSeparator = item.rangeseparator != null ? $"range-separator=\"{item.rangeseparator}\" " : "";
                            var startPlaceholder = item.startplaceholder != null ? $"start-placeholder=\"{item.startplaceholder}\" " : "";
                            var endPlaceholder = item.endplaceholder != null ? $"end-placeholder=\"{item.endplaceholder}\" " : "";
                            var pickerOptions = item.pickeroptions != null ? $":picker-options='{item.pickeroptions.ToJson()}' " : "";
                            var max = item.max != 0 ? $":max=\"{item.max}\" " : "";
                            var allowHalf = item.allowhalf ? "allow-half " : "";
                            var showText = item.showtext ? $"show-text " : "";
                            var showScore = item.showScore ? $"show-score " : "";
                            var showAlpha = item.showalpha ? $"show-alpha " : "";
                            var colorFormat = item.colorformat != null ? $"color-format=\"{item.colorformat}\" " : "";
                            var activeText = item.activetext != null ? $"active-text=\"{item.activetext}\" " : "";
                            var inactiveText = item.inactivetext != null ? $"inactive-text=\"{item.inactivetext}\" " : "";
                            var activeColor = item.activecolor != null ? $"active-color=\"{item.activecolor}\" " : "";
                            var inactiveColor = item.inactivecolor != null ? $"inactive-color=\"{item.inactivecolor}\" " : "";
                            var isSwitch = item.__config__.jnpfKey == "switch" ? $":active-value=\"{item.activevalue}\" :inactive-value=\"{item.inactivevalue}\" " : "";
                            var min = item.min != 0 ? $":min=\"{item.min}\" " : "";
                            var showStops = item.showstops ? $"show-stops " : "";
                            var range = item.range ? $"range " : "";
                            var accept = item.accept != null ? $"accept=\"{item.accept}\" " : "";
                            var showTip = item.showTip ? $"showTip " : "";
                            var fileSize = item.fileSize != 0 ? $":fileSize=\"{item.fileSize}\" " : "";
                            var sizeUnit = item.sizeUnit != null ? $"sizeUnit=\"{item.sizeUnit}\" " : "";
                            var limit = item.limit != 0 ? $":limit=\"{item.limit}\" " : "";
                            var contentposition = item.contentposition != null ? $"content-position=\"{item.contentposition}\" " : "";
                            var buttonText = item.buttonText != null ? $"buttonText=\"{item.buttonText}\" " : "";
                            var level = item.level != 0 ? $":level=\"{item.level}\" " : "";
                            var actionText = item.actionText != null ? $"actionText=\"{item.actionText}\" " : "";
                            var shadow = item.shadow != null ? $"shadow=\"{item.shadow}\" " : "";
                            var content = item.content != null ? $"content=\"{item.content}\" " : "";
                            var noShow = item.__config__.noShow ? "v-if=\"false\" " : "";

                            if (!string.IsNullOrEmpty(item.__vModel__))
                            {
                                model = item.__vModel__.Replace("F_", "").Replace("f_", "").ToPascalCase().ToLower();
                                vModel = $"v-model=\"dataForm.{model}\" ";
                                GeneratorFormDataList.Add(new GeneratorFormColumn()
                                {
                                    vModel = model,
                                    Model = item.__vModel__.Replace("F_", "").Replace("f_", ""),
                                    jnpfKey = item.__config__.jnpfKey,
                                    dataType = item.__config__.dataType,
                                    dictionaryType = config.dataType == "dictionary" ? item.__config__.dictionaryType : (config.dataType == "dynamic" ? item.__config__.propsUrl : null),
                                    props = item.__config__.props != null ? new Utils.PropsModel()
                                    {
                                        label = item.__config__.props.label,
                                        value = item.__config__.props.value
                                    } : null,
                                    format = item.format,
                                    dateType = item.type,
                                    multiple = item.multiple ? item.multiple : (item.__config__.jnpfKey == "checkbox" ? true : false),
                                    billRule = item.__config__.rule,
                                    required = item.__config__.required,
                                    regList = item.__config__.regList,
                                    placeholder = item.__config__.label,
                                    range = item.range,
                                    defaultValue = item.__config__.defaultValue
                                });
                            }
                            sb.AppendLine($"\t\t<el-col :span=\"{config.span}\" {noShow}>");
                            sb.AppendLine($"<el-form-item label=\"{item.__config__.label}\" prop=\"{model}\">");
                            sb.AppendLine($"\t\t\t\t<{config.tag} {vModel}{placeholder}{clearable}{@readonly}{required}{disabled}{show_word_limit}{isRange}{style}{type}{format}{valueFormat}{autosize}{multiple}{size}{prefixIcon}{suffixIcon}{maxlength}{step}{stepStrictly}{controlsPosition}{showChinese}{showPassword}{filterable}{showAllLevels}{rangeSeparator}{startPlaceholder}{endPlaceholder}{separator}{pickerOptions}{max}{min}{allowHalf}{showText}{showScore}{showAlpha}{colorFormat}{activeText}{inactiveText}{activeColor}{inactiveColor}{isSwitch}{showStops}{range}{accept}{showTip}{fileSize}{sizeUnit}{limit}{contentposition}{buttonText}{level}{actionText}{shadow}{content}>");
                            switch (item.__config__.jnpfKey)
                            {
                                case "select":
                                    {
                                        sb.AppendLine($"<el-option v-for=\"(item, index) in {model + "Options"}\" :key=\"index\" :label=\"item.{props.label}\" :value=\"item.{props.value}\" ></el-option>");
                                        switch (item.__config__.dataType)
                                        {
                                            case "static":
                                                GeneratorFormDataOptionsList[model + "Options"] = item.__slot__.options;
                                                break;
                                            default:
                                                GeneratorFormDataOptionsList[model + "Options"] = null;
                                                break;
                                        }
                                    }
                                    break;
                                case "radio":
                                    {
                                        sb.AppendLine($"<el-radio{optionType} v-for=\"(item, index) in {model + "Options"}\" :key=\"index\" :label=\"item.{props.value}\"  >{{item.{props.label}}}</el-radio{optionType}>");
                                        switch (item.__config__.dataType)
                                        {
                                            case "static":
                                                GeneratorFormDataOptionsList[model + "Options"] = item.__slot__.options;
                                                break;
                                            default:
                                                GeneratorFormDataOptionsList[model + "Options"] = null;
                                                break;
                                        }
                                    }
                                    break;
                                case "checkbox":
                                    {
                                        sb.AppendLine($"<el-checkbox{optionType} v-for=\"(item, index) in {model + "Options"}\" :key=\"index\" :label=\"item.{props.value}\" >{{item.{props.label}}}</el-checkbox{optionType}>");
                                        switch (item.__config__.dataType)
                                        {
                                            case "static":
                                                GeneratorFormDataOptionsList[model + "Options"] = item.__slot__.options;
                                                break;
                                            default:
                                                GeneratorFormDataOptionsList[model + "Options"] = null;
                                                break;
                                        }
                                    }
                                    break;
                                case "comInput":
                                    {
                                        if (item.__slot__.prepend != null)
                                        {
                                            sb.AppendLine($"<template slot=\"prepend\">{item.__slot__.prepend}</template>");
                                        }
                                        if (item.__slot__.append != null)
                                        {
                                            sb.AppendLine($"<template slot=\"append\">{item.__slot__.append}</template>");
                                        }
                                    }
                                    break;
                                default:
                                    break;
                            }
                            sb.AppendLine($"</{config.tag}>");
                            sb.AppendLine("\t\t\t</el-form-item>");
                            sb.AppendLine("\t\t</el-col>");
                        }
                        break;
                }
            }
            return sb.ToString();
        }

        /// <summary>
        /// 补充固定字段
        /// </summary>
        /// <returns></returns>
        public List<string> GetFixedFieldList()
        {
            var list = new List<string>();
            list.Add("flowId");
            if (GeneratorFormDataList.Find(c => c.vModel == "status") is null)
            {
                list.Add("actionType");
            }
            else
            {
                list.Add("status");
            }
            list.Add("freeApproverUserId");
            return list;
        }

        public string GenerateAppFlowFormControls(FormDataModel form)
        {
            StringBuilder sb = new StringBuilder();
            foreach (var item in form.fields)
            {
                var config = item.__config__;
                switch (config.jnpfKey)
                {
                    //栅格布局
                    case "row":
                        {
                        }
                        break;
                    //表格
                    case "table":
                        {
                        }
                        break;
                    //卡片
                    case "card":
                        {
                        }
                        break;
                    //分割线
                    case "divider":
                        {
                        }
                        break;
                    //分组标题
                    case "groupTitle":
                        {
                        }
                        break;
                    //文本
                    case "JNPFText":
                        {

                        }
                        break;
                    //
                    case "date":
                        {
                            var model = item.__vModel__.Replace("F_", "").Replace("f_", "").ToPascalCase().ToLower();
                            var placeholder = item.placeholder != null ? $"placeholder=\"{item.placeholder}\" " : "";

                            sb.AppendLine("\t\t\t\t\t\t\t<view class=\"formlistInfo inputtext border-bottom-E3E3E5\">");
                            sb.AppendLine("\t\t\t\t\t\t\t\t<view class=\"labletitle\">");
                            sb.AppendLine($"\t\t\t\t\t\t\t\t\t<label>{config.label}</label>");
                            sb.AppendLine("\t\t\t\t\t\t\t\t</view>");
                            sb.AppendLine("\t\t\t\t\t\t\t\t<view class=\"inputBox\" @tap=\"rchasedatechange\">");
                            sb.AppendLine($"\t\t\t\t\t\t\t\t\t<input type=\"text\" v-model=\"dataForm.{model}\" {placeholder} :disabled=\"disabled\" :name=\"dataForm.{model}\">");
                            sb.AppendLine("\t\t\t\t\t\t\t\t</view>");
                            sb.AppendLine("\t\t\t\t\t\t\t</view>");
                        }
                        break;
                    //
                    case "select":
                        {
                            var model = item.__vModel__.Replace("F_", "").Replace("f_", "").ToPascalCase().ToLower();
                            var placeholder = item.placeholder != null ? $"placeholder=\"{item.placeholder}\" " : "";

                            sb.AppendLine("\t\t\t\t\t\t\t<view class=\"formlistInfo inputtext border-bottom-E3E3E5\">");
                            sb.AppendLine("\t\t\t\t\t\t\t\t<view class=\"labletitle\">");
                            sb.AppendLine($"\t\t\t\t\t\t\t\t\t<label>{config.label}</label>");
                            sb.AppendLine("\t\t\t\t\t\t\t\t</view>");
                            sb.AppendLine($"\t\t\t\t\t\t\t\t<view class=\"inputBox\" @tap=\"{model}change\">");
                            sb.AppendLine($"\t\t\t\t\t\t\t\t\t<input type=\"text\" v-model=\"dataForm.{model}\" {placeholder} :disabled=\"disabled\" :name=\"dataForm.{model}\">");
                            sb.AppendLine("\t\t\t\t\t\t\t\t</view>");
                            sb.AppendLine("\t\t\t\t\t\t\t</view>");
                        }
                        break;
                    default:
                        {
                            var model = item.__vModel__.Replace("F_", "").Replace("f_", "").ToPascalCase().ToLower();
                            var placeholder = item.placeholder != null ? $"placeholder=\"{item.placeholder}\" " : "";

                            sb.AppendLine("\t\t\t\t\t\t\t<view class=\"singleinputBox inputtext border-bottom-E3E3E5\">");
                            sb.AppendLine("\t\t\t\t\t\t\t\t<view class=\"labletitle\">");
                            sb.AppendLine($"\t\t\t\t\t\t\t\t\t<label>{config.label}</label>");
                            sb.AppendLine("\t\t\t\t\t\t\t\t</view>");
                            sb.AppendLine($"\t\t\t\t\t\t\t\t<view class=\"inputBox\" @tap=\"{model}change\">");
                            sb.AppendLine($"\t\t\t\t\t\t\t\t\t<input type=\"text\" v-model=\"dataForm.{model}\" {placeholder}:disabled=\"disabled\"  class=\"singleInputStyle\">");
                            sb.AppendLine("\t\t\t\t\t\t\t\t</view>");
                            sb.AppendLine("\t\t\t\t\t\t\t</view>");
                        }
                        break;
                }
            }
            return sb.ToString();
        }

        public string GenerateAppFlowFormChildreControls(List<FieldsModel> childrenList, int gutter)
        {
            StringBuilder sb = new StringBuilder();
            return sb.ToString();
        }

        #endregion
    }
}

//sb.AppendLine("\t\t\t");
